≡ Menu

Ubuntu: Set OpenDNS DNS Server

How do I set OpenDNS DNS server under Ubuntu Linux desktop operating systems by editing configuration files?
[continue reading…]

{ 0 comments }

What Is Round Robin DNS?

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 – 202.54.1.2
  • foo.dnsknowledge.com – 202.54.1.3

Half of the time when a user make foo.dnsknowledge.com request will go to 202.54.1.2 and rest will go to 202.54.1.3. 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

  1. Load distribution.
  2. Load balancing.
  3. 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
Sample outputs:

google.com has address 74.125.53.100
google.com has address 74.125.45.100
google.com has address 74.125.67.100

So a request to google.com would be split into the 3 server. When you type http://google.com/ first time in a browser, 74.125.53.100 will display google search home page. Type the following command again at the shell prompt:
host -t A google.com
Sample outputs:

google.com has address 74.125.67.100
google.com has address 74.125.53.100
google.com has address 74.125.45.100

Next request would go to the server 74.125.67.100. 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.

Suggested Readings:

{ 2 comments }

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[11794]: general: info: loading configuration from ‘/etc/named.conf’
May 25 15:43:29 ns1 named[11794]: general: info: using default UDP/IPv4 port range: [1024, 65535]
May 25 15:43:29 ns1 named[11794]: general: info: using default UDP/IPv6 port range: [1024, 65535]
May 25 15:43:29 ns1 named[11794]: general: error: the working directory is not writable
May 25 15:43:29 ns1 named[11794]: general: error: zone example.org/IN/external: zone serial has gone backwards
May 25 15:43:29 ns1 named[11794]: general: info: zone example.org/IN/external: loaded serial 2008090814
May 25 15:43:29 ns1 named[11794]: notify: info: zone example.org/IN/external: sending notifies (serial 2008090814)

How do I fix this problem under BIND 9 named server?
[continue reading…]

{ 0 comments }

What is Time To Live (TTL)?

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.
[continue reading…]

{ 15 comments }

What Is NXDOMAIN (Non-Existent Domain)?

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.
[continue reading…]

{ 1 comment }

What Is Authoritative Name Server?

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:

  1. 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.
  2. 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
Sample Outputs:

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:
nslookup
Now set query type to ns at > prompt:
> set query=ns
Now enter domain name such as google.com or dnsknowledge.com:
> dnsknowledge.com
Sample Outputs:

Server:		127.0.0.1
Address:	127.0.0.1#53
Non-authoritative answer:
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 = 208.43.138.52
ns2.nixcraft.net	internet address = 75.126.168.152
ns3.nixcraft.net	internet address = 208.43.78.162
> 

How Do I Register Authoritative Name Server?

  1. First, you need to register a domain name with your domain name registrar.
  2. 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

Fig.01: Setting Up Authoritative DNS Name Server

{ 14 comments }

What Is TLD 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.
[continue reading…]

{ 5 comments }

What Is Resolving Name Server?

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.
[continue reading…]

{ 3 comments }

How DNS Works

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.

DNS Implementations

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?

  1. You type a domain name such as google.com into your browser using client computer operating system such as Windows or Apple OS (“client”).
  2. 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).
  3. Your browser will send this query to the operating system.
  4. Each operating system is configured to query certain dns servers. Typically your ISP or network administrator configures such dns servers called Resolving Name Server.
  5. The resolving name server does not aware of the location of the google.com, but it does know where the root servers are located.
  6. 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.
  7. 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 @4.2.2.1 google.com
OR
dig +trace @your-isps.dns.server.ip google.com
Sample Outputs:

; <<>> DiG 9.5.0-P2 <<>> +trace @4.2.2.1 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 4.2.2.1#53(4.2.2.1) 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 192.112.36.4#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 192.41.162.30#53(L.GTLD-SERVERS.NET) in 439 ms

google.com.		300	IN	A	74.125.67.100
google.com.		300	IN	A	74.125.45.100
google.com.		300	IN	A	74.125.127.100
;; Received 76 bytes from 216.239.36.10#53(ns3.google.com) in 303 ms

In above example:

  • 4.2.2.1 is resolving name server.
  • 4.2.2.1 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. 74.125.67.100
  • 4.2.2.1 caches result and returns actual IP address of google.com i.e. 74.125.67.100 to operating system.
{ 5 comments }

What is DNS?

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 67.228.49.226 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 67.228.49.226). 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 67.228.49.226 (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:

  1. The DNS server.
  2. The DNS client (also resolver).

Why Use DNS?

  1. Each packet that is sent across an IP network over LAN or the Internet must contain a destination IP address.
  2. However, users prefer to identify destination hosts by hostname rather than IP addresses.
  3. Numerical IP addresses are difficult to remember.
  4. Almost, all applications such as web browser, e-mail client and other apps allow users to enter destinations as hostname.
  5. Your applications will automatically translate those hostnames to IP addresses using resolver library functions for communication.
  6. DNS makes it easy to remember network names, server names, file server names, web site names and e-mail address for network users.

Summery

  • 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.
{ 15 comments }