NAME SERVICES
Name services play a crucial role in distributed systems by providing a means to identify, locate, and manage resources through human-readable names. They enable users and applications to interact with various resources without needing to know their physical locations or underlying addresses.
Functions of Name Services
- Name Resolution: Converting human-readable names into resource identifiers, such as IP addresses, object references, or service handles.
- Directory Services: Storing and providing additional information about resources, such as attributes, properties, and metadata.
- Name Management: Creating, deleting, and organizing names within a namespace, ensuring consistency and uniqueness.
- Scalability and Availability: Ensuring that the name service can handle a large number of queries and remain available despite network failures or high loads.
- Security: Providing mechanisms to ensure the integrity and authenticity of the name-to-resource mappings.
Types of Name Services
- Domain Name System (DNS):
- Translates domain names to IP addresses.
- Organized hierarchically, with top-level domains (e.g., .com, .org) and subdomains.
- Provides various record types (A, AAAA, CNAME, MX, etc.).
- Lightweight Directory Access Protocol (LDAP):
- Used for accessing and managing directory services over a network.
- Stores hierarchical information about users, groups, devices, and other resources.
- Commonly used for authentication and authorization in enterprise environments.
- Java Naming and Directory Interface (JNDI):
- A Java API for accessing various naming and directory services.
- Provides a unified interface to interact with different naming and directory services like DNS, LDAP, and RMI registries.
- Allows Java applications to look up and bind objects, such as EJB components, data sources, and environment variables.
- Network Information Service (NIS):
- Provides a distributed database for sharing configuration information within a network.
- Commonly used in Unix and Linux environments to manage user and group information, hostnames, and other configuration data.
DOMAIN NAME SYSTEM (DNS)
DNS is a hierarchical and decentralized naming system for computers, services, or any resource connected to the Internet or a private network. It translates human-readable domain names (like www.ezexplanation.com) into IP addresses (like 192.0.2.1), which are used by computers to identify each other on the network.
Components of DNS
- Domain Names: Structured in a hierarchical manner, consisting of labels separated by dots (e.g., www.ezexplanation.com).
- DNS Zones: Segments of the DNS namespace that are managed by a particular organization or administrator.
- DNS Records: Data associated with domain names, including:
- A Record: Maps a domain name to an IPv4 address.
- AAAA Record: Maps a domain name to an IPv6 address.
- CNAME Record: Maps a domain name to another domain name (canonical name).
- MX Record: Specifies mail servers for email routing.
- TXT Record: Contains text information, often used for verification and security purposes.
Working of DNS
Consider a scenario where an application needs to find the IP address of a web server using DNS:
- Query Initiation: The application sends a DNS query for www.ezexplanation.com to a DNS resolver.
- Recursive Resolution:
- The resolver checks its cache for the IP address.
- If not found, it queries a root DNS server.
- The root server responds with the address of the TLD server for .com.
- The resolver queries the .com TLD server, which responds with the authoritative DNS server for example.com.
- The resolver queries the authoritative server, which returns the IP address for www.example.com.
- Response: The resolver caches the result and returns the IP address to the application.
- Connection: The application uses the IP address to establish a connection to the web server.
DNS Server Types
- Recursive Resolver: Receives queries from client machines and recursively queries other DNS servers to resolve the domain name.
- Root Name Server: The top-level DNS server that directs queries to appropriate TLD (Top-Level Domain) servers.
- TLD Name Server: Manages top-level domains (e.g., .com, .org) and directs queries to authoritative name servers.
- Authoritative Name Server: Contains the DNS records for specific domains and responds to queries with the definitive answers.
DNS Resolution Process
- Query Initiation: A user enters a domain name in their web browser.
- Recursive Query: The query is sent to a recursive resolver.
- Root Server Query: If the resolver does not have the cached answer, it queries a root name server.
- TLD Server Query: The root server responds with the address of a TLD server.
- Authoritative Server Query: The TLD server responds with the address of the authoritative name server for the requested domain.
- Final Resolution: The authoritative name server returns the IP address associated with the domain name.
- Response: The resolver sends the IP address back to the client, which then connects to the web server.
DNS Security
- DNSSEC (DNS Security Extensions): Adds security to DNS by enabling DNS responses to be verified for authenticity.
- TSIG (Transaction Signatures): Provides a way to secure updates and communications between DNS servers.
- DNS Over HTTPS (DoH) and DNS Over TLS (DoT): Encrypt DNS queries to enhance privacy and security.