Network Integration  «Prev 

Using DNS to resolve hostnames into IP addresses

resolv.conf, a computer file utilized in various operating systems, is responsible for configuring the Domain Name System (DNS) resolver of the system. Typically, this plain-text file is created by the network administrator or applications managing the configuration of the system. One such program that manages the resolv.conf file is the resolvconf program found in FreeBSD or other Unix machines. The primary function of the resolv.conf configuration file is to provide information regarding the operational parameters of the DNS resolver in most Unix-like operating systems and those implementing the BIND DNS resolver library. By translating human-friendly domain names into numeric IP addresses, the DNS resolver enables applications to access resources on the local area network or the Internet. This process of translating domain names to IP addresses is known as resolving.
The resolv.conf file usually contains directives that specify default search domains, which are used to complete a query name to a fully qualified domain name when a domain suffix is not supplied. Additionally, it also contains a list of IP addresses of available nameservers used for resolution. In conclusion, resolv.conf plays a crucial role in configuring the DNS resolver in various operating systems. Its contents are essential in determining the operational parameters of the DNS resolver, making it possible for applications to translate human-friendly domain names into the numeric IP addresses necessary for accessing resources on the local area network or the Internet.

/etc/resolv.conf file

1) A typical /etc/resolv.conf looks like this.
1) A typical /etc/resolv.conf looks like this

2) Three keywords used in the /etc/resolv.conf file: domain, search, and nameserver. Each line begins with a keyword and is followed by that keyword's values, separated by white space.
2) Three keywords used in the /etc/resolv.conf file:
  1. domain,
  2. search, and
  3. nameserver.
Each line begins with a keyword and is followed by that keyword's values, separated by white space.

3) Domain keyword specifies your domain name. In this case, it is 'mydomain
3) Domain keyword specifies your domain name. In this case, it is 'mydomain'

4) The search keyword tells the DNS application what other domains to look for in hosts that do not exist in your domain.
4) The search keyword tells the DNS application what other domains to look for in hosts that do not exist in your domain.

5) Finally, each instance of the nameserver keyword lists the IP address of a DNS server to contact to resolve hostnames to IP addresses.
5) Finally, each instance of the nameserver keyword lists the IP address of a DNS server to contact to resolve hostnames to IP addresses.