We describe the main architecture and the design principles of the service/resource discovery system (SRDS), a component of the XtreemOS operating system. XtreemOS is a Linux extension that enables management and exploitation as single platform of computational resources provided by federated virtual organizations. The SRDS provides scalable and fault-tolerant directory services supporting many of the platform functionalities, ranging from dynamic resource location and job control to system and application-oriented directory services. The key challenge of the SRDS design is to provide the common metaphor of the directory service, meeting the scalability requirements of a grid-aware operating system, and at the same time enjoy extendability and configurability, especially with respect to the quality of service provided. The SRDS design combines different peer to peer structured overlay networks, exploiting their peculiar strengths. We describe the implementation and our design of the namespace abstraction as implemented on top of multiple overlay networks. Finally, we show test results of the SRDS on top of a subset of the Grid5000 platform.