Praise be to Allah.
There is nothing wrong with renting a known amount of space on Internet servers, then dividing it up and renting it out to website owners for an annual or monthly fee.
As for renting unlimited space, that is not valid, because the condition of rental contracts and sales is that it should be known what the thing is that is being rented or purchased. Not knowing constitutes ambiguity and risk, each of which may lead to disputes. Hence sharee‘ah does not permit that.
Muslim (1513) narrated that Abu Hurayrah said: The Messenger of Allah (blessings and peace of Allah be upon him) forbade transactions involving ambiguity.
Ambiguity means not knowing what is being bought or rented, and taking risks, which leads to disputes.
In al-Mawsoo‘ah al-Fiqhiyyah (30/224) it says: it is stipulated that the object of the contract should be defined and known to both parties, so that there are no unknown elements that could lead to dispute and ambiguity. Having knowledge of the object of the contract and distinguishing it from other things is achieved by seeing it or part of it at the time of the contract, or by describing it in such a way that explains exactly what it is, or by pointing at it. This condition is unanimously agreed upon among the fuqaha’ with regard to contracts of buying and selling in general. So it is not permissible to sell “a sheep in the flock (without identifying a particular sheep)” for example, or to rent out “one of these two houses”. That is because not knowing what the object of the contract is leads to ambiguity and disputes. With regard to this matter, some fuqaha’ differentiated between having no knowledge of the object of the transaction, which is what leads to disputes, and having no knowledge about a little of the object of the transaction, which does not lead to disputes. So they forbade the former and permitted the latter. End quote.
And Allah knows best.