Which part of speech is desert in the following sentence.

He lived for a year on a desert island.

It looks like an adjective in the above example, but dictionaries suggest that it is always noun.

It's a noun that modifies another noun. Such constructions are called compound nouns. English has hundreds of them.

desert island, mountain trail, sea bird, kitchen table, vegetable soup, chicken sandwich, garden fence, city street, butterfly wing, gravel road, office desk, fruit bowl, book jacket, library paste, car door, wheat harvest, safety glasses, telephone pole, fire hose, table cloth, country lane, man hole, greeting card, tea cup, cigarette lighter, carpet cleaner, cottage fries, stomach ache, knee pad, fortune teller, force field, neutron star, snake venom, powder puff, medicine man, ground cover, beef stew, apple cider, peach cobbler, raspberry jam, computer screen, burglar alarm, skeleton key, ocean currents, ...

Thank you very much Jim.

In all your examples, compound nouns are separated.

Can those nouns wich are attached together or separated with hyphens be considered as compoun nouns?

Students: Are you brave enough to let our tutors analyse your pronunciation?
Yes. Absolutely. I believe those are the three types of compound nouns. I don't think there are any other types.