Round robin DNS is nothing but a simple technique of load balancing various Internet services such as Web server, e-mail server by creating multiple DNS A records with the same name.
How Does It Works?
You configure DNS server to send a list of IP addresses of several servers with same hostname. For example, foo.dnsknowledge.com may be configured to return two IP address as follows:
- foo.dnsknowledge.com – 220.127.116.11
- foo.dnsknowledge.com – 18.104.22.168
Half of the time when a user make foo.dnsknowledge.com request will go to 22.214.171.124 and rest will go to 126.96.36.199. In other words, all clients would receive service from two different server, thus distributing the overall load among servers.
Round Robin DNS Usage
You can use round robin DNS for
- Load distribution.
- Load balancing.
- Fault-tolerance service.
Round Robin DNS Example
Open a terminal (Mac OS X or UNIX / Linux) and type the following command to see IP address of google.com:
host -t A google.com
google.com has address 188.8.131.52
google.com has address 184.108.40.206
google.com has address 220.127.116.11
So a request to google.com would be split into the 3 server. When you type http://google.com/ first time in a browser, 18.104.22.168 will display google search home page. Type the following command again at the shell prompt:
host -t A google.com
google.com has address 22.214.171.124
google.com has address 126.96.36.199
google.com has address 188.8.131.52
Next request would go to the server 184.108.40.206. By using Round Robin DNS google managed to lighten the webserver load. This kind of setup pretty common among the large website such as google.com, amazon.com, yahoo.com etc. If your site gets a large number of hits (millions of unique hits per day) per day, consider using this technique.
I see the following error in my /var/log/messages file under Linux operating systems running BIND 9 master name server:
May 25 15:43:29 ns1 named: general: info: loading configuration from ‘/etc/named.conf’
May 25 15:43:29 ns1 named: general: info: using default UDP/IPv4 port range: [1024, 65535]
May 25 15:43:29 ns1 named: general: info: using default UDP/IPv6 port range: [1024, 65535]
May 25 15:43:29 ns1 named: general: error: the working directory is not writable
May 25 15:43:29 ns1 named: general: error: zone example.org/IN/external: zone serial has gone backwards
May 25 15:43:29 ns1 named: general: info: zone example.org/IN/external: loaded serial 2008090814
May 25 15:43:29 ns1 named: notify: info: zone example.org/IN/external: sending notifies (serial 2008090814)
How do I fix this problem under BIND 9 named server?
Time to live (TTL) is used for computer data including DNS servers. It is nothing but time on the period of time or number of iterations or transmissions in computer and computer network technology that a unit of data (e.g. a packet) can experience before it should be discarded.
A NXDOMAIN is Non-Existent Domain. It is a term used for the Internet domain name that is unable to be resolved using the DNS servers or domain name not yet registered. NXDOMAIN can also take place due to the network or DNS server problem.
An authoritative name server provides actual answer to your DNS queries such as – mail server IP address or web site IP address (A resource record). It provides original and definitive answers to DNS queries. It does not provides just cached answers that were obtained from another name server. Therefore it only returns answers to queries about domain names that are installed in its configuration system. There are two types of Authoritative Name Servers:
- Master server (primary name server) – A master server stores the original master copies of all zone records. A hostmaster only make changes to master server zone records. Each slave server gets updates via special automatic updating mechanism of the DNS protocol. All slave servers maintain an identical copy of the master records.
- Slave server (secondary name server) – A slave server is exact replica of master server. It is used to share DNS server load and to improve DNS zone availability in case master server fails. It is recommend that you should at least have 2 slave servers and one master server for each domain name.
How Do I View Authoritative Name Server Names and IP Address?
The multiple name servers make sure that the domain still functional even if one name server becomes inaccessible or inoperable due to security or overloading issues. On the internet each domain name assigned a set of authoritative name servers. You can find out authoritative name servers by typing the following command at shell prompt (works with UNIX / Linux and Mac OS X):
host -t ns dnsknowledge.com
dnsknowledge.com name server ns2.nixcraft.net.
dnsknowledge.com name server ns3.nixcraft.net.
dnsknowledge.com name server ns1.nixcraft.net.
You can also use nslookup command under MS-Windows or UNIX like operating systems. Type the command:
Now set query type to ns at > prompt:
> set query=ns
Now enter domain name such as google.com or dnsknowledge.com:
dnsknowledge.com nameserver = ns3.nixcraft.net.
dnsknowledge.com nameserver = ns2.nixcraft.net.
dnsknowledge.com nameserver = ns1.nixcraft.net.
Authoritative answers can be found from:
ns1.nixcraft.net internet address = 220.127.116.11
ns2.nixcraft.net internet address = 18.104.22.168
ns3.nixcraft.net internet address = 22.214.171.124
How Do I Register Authoritative Name Server?
- First, you need to register a domain name with your domain name registrar.
- Each domain name registrar allows you to set a primary name server (master server) and at least one secondary name server (slave server).
For example, DNSKnowledge.com domain name is registered with GoDaddy domain name registrar. GoDaddy (or any other domain name registrar) allows you to change the DNS authoritative name server at the time of registration or later any time.
Fig.01: Setting Up Authoritative DNS Name Server
A TLD (top-level domain) is the highest level of domain names in the root zone of the DNS of the Internet. For all domains in lower levels, it is the last part of the domain name, that is, the label that follows the last dot of a fully qualified domain name. In other words the last part of an Internet domain name that follow the final dot of a fully qualified domain name. For example, in the domain name www.dnsknowledge.com, the top-level domain is com.
Resolving name servers are very useful for dialup, cable modem, ADSL, DSL, VPN and similar users. A resolving name servers is provided by your ISP (internet service provider) or your organizations network admin or third party resolving name servers. Resolving name servers directly finds out information about the root servers, top level domains and authoritative name servers. It also speed up queries by caching results locallly as configured by hostmater in their domains’ TTL field.
The DNS is the default name resolution service used in UNIX (configurable option) and Windows servers.
However, when the Internet was very small, hostname resolution was done using /etc/hosts file under UNIX. The hosts file is a computer file used by an operating system to map hostnames to IP addresses. MS-Windows also support the hosts file and usaully locate at %SystemRoot%\system32\drivers\etc\ directory.
However, these days Domain Name System is the default name resolution service used in all operating systems including mobile phones such as Apple iPhone. DNS is part of the operating system and all TCP/IP network connections are, by default, configured with the IP address of at least two DNS server to perform name resolution on the network. In this tutorial, we’ll take a look at the DNS system.
Resolving Name With DNS
DNS is used to map a domain name to an IP address. For e.g. when you type a domain such as dnsknowledge.com into your browser the client needs to find the IP address where this website is located. This is done using DNS servers. However, keep in mind that over last few years the Internet grew into the tens of thousands (there may be billions of IP address active with hostnames), a more flexible more scalable solution was required. The DNS makes is possible to manage millions of hostnames and IP address efficiently. The DNS has become the main name resolution used on the Internet today.
There have been various implementation of DNS over the years. UNIX systems typically use BIND (Berkeley Internet Name Domain) or djbdns. Microsoft Windows Server operating systems typically use a non-Active Directory, or standard, Domain Name System solution. However, various implemntations use the same protocols for exchanging DNS information over the Internet.
How does DNS works?
- You type a domain name such as google.com into your browser using client computer operating system such as Windows or Apple OS (“client”).
- The client needs to find the IP address where google.com search engine is located on the earth (typically all websites are hosted in the Internet data center).
- Your browser will send this query to the operating system.
- Each operating system is configured to query certain dns servers. Typically your ISP or network administrator configures such dns servers called Resolving Name Server.
- The resolving name server does not aware of the location of the google.com, but it does know where the root servers are located.
- Next, the resolving name server find the location of the top-level domain name server to send query for google.com. Each domain on the Internet has authoritative name server.
- Finally, the authoritative name server will give you exact IP address of google.com. This information will come back to to the resolving name server, which caches the information and send backs an answer (answer to your query what is IP address of google.com) to the browser to the correct place. The end result you will see google search engine home page.
You can easily verify above sequence using your ISP’s dns server. If you are using UNIX or Mac OS X, open the terminal and type the following command:
dig +trace @126.96.36.199 google.com
dig +trace @your-isps.dns.server.ip google.com
; <<>> DiG 9.5.0-P2 <<>> +trace @188.8.131.52 google.com
; (1 server found)
;; global options: printcmd
. 3600000 IN NS G.ROOT-SERVERS.NET.
. 3600000 IN NS F.ROOT-SERVERS.NET.
. 3600000 IN NS J.ROOT-SERVERS.NET.
. 3600000 IN NS I.ROOT-SERVERS.NET.
. 3600000 IN NS E.ROOT-SERVERS.NET.
. 3600000 IN NS D.ROOT-SERVERS.NET.
. 3600000 IN NS M.ROOT-SERVERS.NET.
. 3600000 IN NS H.ROOT-SERVERS.NET.
. 3600000 IN NS B.ROOT-SERVERS.NET.
. 3600000 IN NS C.ROOT-SERVERS.NET.
. 3600000 IN NS A.ROOT-SERVERS.NET.
. 3600000 IN NS L.ROOT-SERVERS.NET.
. 3600000 IN NS K.ROOT-SERVERS.NET.
;; Received 228 bytes from 184.108.40.206#53(220.127.116.11) in 363 ms
com. 172800 IN NS C.GTLD-SERVERS.NET.
com. 172800 IN NS I.GTLD-SERVERS.NET.
com. 172800 IN NS F.GTLD-SERVERS.NET.
com. 172800 IN NS G.GTLD-SERVERS.NET.
com. 172800 IN NS E.GTLD-SERVERS.NET.
com. 172800 IN NS M.GTLD-SERVERS.NET.
com. 172800 IN NS A.GTLD-SERVERS.NET.
com. 172800 IN NS D.GTLD-SERVERS.NET.
com. 172800 IN NS J.GTLD-SERVERS.NET.
com. 172800 IN NS H.GTLD-SERVERS.NET.
com. 172800 IN NS K.GTLD-SERVERS.NET.
com. 172800 IN NS B.GTLD-SERVERS.NET.
com. 172800 IN NS L.GTLD-SERVERS.NET.
;; Received 488 bytes from 18.104.22.168#53(G.ROOT-SERVERS.NET) in 215 ms
google.com. 172800 IN NS ns1.google.com.
google.com. 172800 IN NS ns2.google.com.
google.com. 172800 IN NS ns3.google.com.
google.com. 172800 IN NS ns4.google.com.
;; Received 164 bytes from 22.214.171.124#53(L.GTLD-SERVERS.NET) in 439 ms
google.com. 300 IN A 126.96.36.199
google.com. 300 IN A 188.8.131.52
google.com. 300 IN A 184.108.40.206
;; Received 76 bytes from 220.127.116.11#53(ns3.google.com) in 303 ms
In above example:
- 18.104.22.168 is resolving name server.
- 22.214.171.124 queries root servers such as G.ROOT-SERVERS.NET. and others as it doesn’t aware of google.com’s IP address.
- G.ROOT-SERVERS.NET (one of root server) queries top level domain name server (.com server) to find out authoritative name server for google.com using L.GTLD-SERVERS.NET.
- L.GTLD-SERVERS.NET points back to ns3.google.com (one of name server of domain google.com) and its IP address.
- ns3.google.com returns actual IP address of google.com i.e. 126.96.36.199
- 188.8.131.52 caches result and returns actual IP address of google.com i.e. 184.108.40.206 to operating system.
DNS stands for “Domain Name System”.
The DNS is a naming system for computers, servers and other network devices over the Internet. It is used for resolving hostnames to IP addresses or vice versa. For e.g. hostname server.dnsknowledge.com has IPv4 address 220.127.116.11 and has IPv6 address 2607:f0d0:1002:11::9. In other words DNS is used for associating a domain name (such as dnsknowledge.com) to an IP address (such as 18.104.22.168). It just work like the “phone book” for the Internet by translating easy remember computer or server names into IP addresses.
Internet domain names are easier to remember than IP addresses such as 22.214.171.124 (IPv4) or 2607:f0d0:1002:11::9 (IPv6). Using DNS one can remember URLs such as google.com and e-mail addresses without having to know how the machine will actually locate them.
The DNS is suite of protocols that comprise TCP/IP. All major operating systems, network devices, mobile phones, and PDAs supports DNS. DNS is always implemented using two software components:
- The DNS server.
- The DNS client (also resolver).
Why Use DNS?
- Each packet that is sent across an IP network over LAN or the Internet must contain a destination IP address.
- However, users prefer to identify destination hosts by hostname rather than IP addresses.
- Numerical IP addresses are difficult to remember.
- Almost, all applications such as web browser, e-mail client and other apps allow users to enter destinations as hostname.
- Your applications will automatically translate those hostnames to IP addresses using resolver library functions for communication.
- DNS makes it easy to remember network names, server names, file server names, web site names and e-mail address for network users.
- DNS is created for us to translate human-friendly computer names into IP addresses.
- DNS is critical for the Internet.
- DNS is an essential component of the functionality of the internet including e-mail, anti-spam, distributing software updates and much more.
BELL Canada a consumer ISPs have started the practice of DNS hijacking on non-existent domain names, for the purpose of making money by displaying advertisements. This practice violates the RFC standard for DNS (NXDOMAIN) responses, and can potentially open users to cross-site scripting attacks. This is confirmed by several members of broadband web forum.