DistributedNetworks DistributedNetworks

Network Integration  «Prev 

Using DNS to resolve hostnames into IP addresses

resolv.conf is the name of a computer file used in various operating systems to configure the system's Domain Name System (DNS) resolver. The file is a plain-text file usually created by the network administrator or by applications that manage the configuration tasks of the system. The resolvconf program is one such program on FreeBSD or other Unix machines which manages the resolv.conf file.
purpose: In most Unix-like operating systems and others that implement the BIND Domain Name System (DNS) resolver library, the resolv.conf configuration file contains information that determines the operational parameters of the DNS resolver. The DNS resolver allows applications running in the operating system to translate human-friendly domain names into the numeric IP addresses that are required for access to resources on the local area network or the Internet. The process of determining IP addresses from domain names is called resolving.
Contents and Location: The file resolv.conf typically contains directives that specify the default search domains; used for completing a given query name to a fully qualified domain name when no domain suffix is supplied. It also contains a list of IP addresses of nameservers available for resolution.

/etc/resolv.conf file

A typical /etc/resolv.conf looks like this

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.

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

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

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