Lesson 6 | Using DNS to resolve hostnames into IP addresses |
Objective | Configure your network interface to use DNS. |
Using DNS to resolve hostnames into IP Addresses
Using Linux Network Integration
In large networks, the disadvantages of Host Tables become apparent: there are simply too many hosts constantly connecting and disconnecting from the network. You would have to edit the Host Table constantly, leaving no time for useful computing.
High level Overview of DNS
DNS (Domain Name System) is a hierarchical system used to translate domain names into IP addresses. Domain names, such as www.example.com, are easy for humans to remember and use, but computers communicate with each other using IP addresses, such as 192.168.0.1.
The DNS system consists of a global network of DNS servers that work together to provide the translation between domain names and IP addresses. When a user enters a domain name into their web browser, the browser sends a request to a local DNS resolver, which then queries the DNS system to find the corresponding IP address. The DNS system uses a hierarchical structure, with top-level domains (TLDs) at the highest level, followed by second-level domains (SLDs), and then subdomains. Each domain is managed by a DNS server, which is responsible for storing information about the domain and its corresponding IP address.
DNS servers use a caching system to improve performance and reduce the load on the network. When a DNS server receives a request for a domain name, it first checks its cache to see if it has a record of the domain and its corresponding IP address. If it does, it can immediately provide the answer without having to query other DNS servers.
Overall, DNS plays a critical role in enabling users to access websites and other online resources using easy-to-remember domain names, while allowing computers to communicate with each other using IP addresses. The hierarchical structure of the DNS system and the use of caching help to ensure efficient and reliable performance for users around the world.
The solution is a large database that is spread among many computers. The most common system is the Domain Name System (DNS).
Each DNS machine keeps a database of names and addresses. The database is updated constantly to reflect the current state of the network.
When requests are made, the server searches for the hostname and, if found, returns the IP address. If the server does not find the IP address, it asks other DNS servers to try and find the hostname.
Likewise, if the DNS server receives an IP address, it will return the hostname, if found, or ask other servers to look up the IP address.
Configuring client-side DNS
In order to use DNS, you must specify at least the primary DNS server's IP address. If the primary DNS fails to resolve the hostname, Linux consults any backup DNS servers you specified. The DNS configuration information is stored in two files, /etc/host.conf
and /etc/resolv.conf
. The /etc/host.conf
file describes how your Linux machine connects to DNS. The default configuration is adequate.
However, you must manually configure the /etc/resolv.conf
file, as described in the Slide Show below.
Using DNS resolve
Linux contacts the nameservers in the /etc/resolv.conf file in the order you list them. Put your primary DNS as the first entry, and all backup DNS servers afterward.