Sayyiduna Ibn Umar (may Allah be pleased with them both) says that Sayyiduna Umar (may Allah be pleased with him) acquired land at Khaybar. He came to the Prophet (peace and blessings be upon him) and said: "I have acquired land at Khaybar such that nothing like it is better in my eyes. What do you (peace and blessings be upon him) command me regarding it?" He (peace and blessings be upon him) said: "If you wish, retain the land itself and give its produce in charity." So Sayyiduna Umar (may Allah be pleased with him) gave it in charity on the condition that it would not be sold, nor inherited, nor gifted. He gave it in charity for the poor, for relatives, in freeing slaves, in the path of Allah, for the guest and for the traveller; and there is no harm on its manager if he eats from it in a reasonable manner or feeds a friend, without amassing wealth from it.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الوقف / 11887