Domain Name Service (DNS) is an Internet service that maps IP addresses and fully qualified domain names (FQDN) to one another. In this way, DNS alleviates the need to remember IP addresses. Computers that run DNS are called name servers. Ubuntu ships with BIND (Berkley Internet Naming Daemon), the most common program used for maintaining a name server on Linux. Show
InstallationAt a terminal prompt, enter the following command to install dns:
A very
useful package for testing and troubleshooting DNS issues is the
ConfigurationThere are many ways to configure BIND9. Some of the most common configurations are a caching nameserver, primary server, and secondary server.
OverviewThe DNS configuration files are stored in the
The root nameservers used to be described in the file It is possible to configure the same server to be a caching name server, primary, and secondary: it all depends on the zones it is serving. A server can be the Start of Authority (SOA) for one zone, while providing secondary service for another zone. All the while providing caching services for hosts on the local LAN. Caching NameserverThe default configuration acts as a caching server. Simply uncomment and edit
To enable the new configuration, restart the DNS server. From a terminal prompt:
See dig for information on testing a caching DNS server. Primary ServerIn this section BIND9 will be configured as the Primary server for the domain Forward Zone FileTo add a DNS zone to BIND9, turning BIND9 into a Primary server, first edit
Now use an existing zone file as a template to create the
Edit the new zone file Create an A record for the base domain,
You must increment the Serial Number every time you make changes to the zone file. If you make multiple changes before restarting BIND9, simply increment the Serial once. Now, you can add DNS records to the bottom of the zone file. See Common Record Types for details.
Once you have made changes to the zone file BIND9 needs to be restarted for the changes to take effect:
Reverse Zone FileNow that the zone is setup and resolving names to IP Addresses, a Reverse zone needs to be added to allows DNS to resolve an address to a name. Edit
Now create the
Next edit
The Serial Number in the Reverse zone needs to be incremented on each change as well. For each A record you configure in After creating the reverse zone file restart BIND9:
Secondary ServerOnce a Primary Server has been configured a Secondary Server is highly recommended in order to maintain the availability of the domain should the Primary become unavailable. First, on the Primary server, the zone transfer needs to be allowed. Add the
Restart BIND9 on the Primary server:
Next, on the Secondary server, install the bind9 package the same way as on the Primary. Then edit the
Restart BIND9 on the Secondary server:
In
TroubleshootingThis section covers diagnosing problems with DNS and BIND9 configurations. Testingresolv.confThe first step in testing BIND9 is to add the nameserver’s IP Address to a hosts resolver. The Primary nameserver should be configured as well as another host to double check things. Refer to DNS client configuration for details on adding nameserver addresses to your network clients. In the end
your
To check which DNS server your local resolver is using, run:
digIf you installed the dnsutils package you can test your setup using the DNS lookup utility dig:
pingNow to demonstrate how applications make use of DNS to resolve a host name use the ping utility to send an ICMP echo request:
This tests if the nameserver can resolve the name
named-checkzoneA great way to test your zone files is by using the
Quick temporary query loggingWith the To turn query logging on, run:
Likewise, to turn it off, run:
The logs will be sent to syslog and will show up in
LoggingBIND9 has a wide variety of logging configuration options available, but the two main ones are channel and category, which configure where logs go, and what information gets logged, respectively. If no logging options are configured the default configuration is:
Let’s instead configure BIND9 to send debug messages related to DNS queries to a separate file. We need to configure
a channel to specify which file to send the messages to, and a category. In this example, the category will log all queries. Edit
You should see the file ReferencesCommon Record TypesThis section covers some of the most common DNS record types.
More Information
Which zone is used to determine the IP address of a computer from its FQDN?DNS zones. DNS Servers host zones which in turn host records that resolve a name to an IP address. The zone is the authoritative source for information about the domain name managed by that zone. A DNS zone is typically the same as the domain name being hosted on the DNS Server.
What is reverse lookup zone in DNS?A reverse DNS lookup is a DNS query for the domain name associated with a given IP address. This accomplishes the opposite of the more commonly used forward DNS lookup, in which the DNS system is queried to return an IP address.
Which of the following is an example of FQDN?[tld]. For example, "www.techterms.com." is an FQDN since it contains a hostname ("www") and a domain name ("techterms.com"), followed by a trailing period. The name "techterms.com" is not fully qualified because it does not include a hostname or end with a period.
How do I find the FQDN of an IP address?Type "ipconfig" and press "Enter." This displays the IP address for your Windows server. Use this IP address to view the fully qualified domain name of the server.
|