≡ Menu

Bind dns

Linux Mail Delivery Failed With DNS Service Unavailable Error and Solution

Q. I get following error message for my postfix email server:

Mail Delivery Failed With DNS Service Unavailable Error and Solution

How do I fix this problem?
[click to continue…]

Troubleshoot Linux / UNIX bind dns server zone problems with named-checkzone tool

Q. How do I check my domain zone file for error and validity the same under BIND DNS Server version 9?

A. You need to use named- checkzone command as zone file validity checking tool. It is useful for checking zone files before configuring them into a name server.

named-checkzone command syntax

named-checkzone {zonename} {filename}
Where,

  • zonename : The domain name of the zone being checked.
  • filename : The name of the zone file.

How do I check my zone file configuration for errors?

Use named-checkzone to check the zone files as follows:
named-checkzone nixcraft.com /var/named/zone.nixcraft.com
Output:

OK

If you see “OK” as result, the zone file is properly configured and you can restart bind name server.

How do I setup round robin DNS?

Round robin DNS is a technique in which load balancing is performed by a DNS server instead of a strictly dedicated machine. A DNS record has more than one value IP address.

When a request is made to the DNS server which serves this record, the answer it gives alternates for each request. For instance, if you had a three webserver that you wished to distribute requests between, you could setup your DNS zone as follows:

Open your zone file using vi text editor and add/modify www entry as follows:
# vi zone.cyberciti.biz
Append/modfiy www entry:

www   IN   A   68.142.234.44
          IN   A   68.142.234.45
          IN   A   68.142.234.46
         IN   A   68.142.234.47

Save and restart BIND9. If you run nslookup for cyberciti.biz:

# nslookup cyberciti.biz

Output:

Address: 68.142.234.47
Name:   cyberciti.biz
Address: 68.142.234.44
Name:   cyberciti.biz
Address: 68.142.234.45
Name:   cyberciti.biz
Address: 68.142.234.46

One more time:
# nslookup cyberciti.biz
Output:

Name:   cyberciti.biz
Address: 68.142.234.46
Name:   cyberciti.biz
Address: 68.142.234.45
Name:   cyberciti.biz
Address: 68.142.234.44
Name:   cyberciti.biz
Address: 68.142.234.47

When a query is made to the DNS server it will first give the IP of 68.142.234.44 for the www host. The next time a request is made for the IP of www, it will serve 68.142.234.45 and so on.

The order in which IP addresses from the list are returned is the basis of the round robin name. While this is a form of load balancing, it should be noted that if one of the hosts becomes unavailable, the DNS server does not know this, and will still continue to give out the IP of the downed server.