Technical article 112741

What are the tools available to run diagnostics on my DNS configuration?

OpenServer 6.0.0OpenServer 5.0.5OpenServer 5.0.6OpenServer 5.0.7UnixWare 7.1.0UnixWare 7.1.1UnixWare 7.1.3UnixWare 7.1.4Open UNIX 8

Written · Last revised

Problem

It takes a long time to connect to my server using the DNS name.

It takes over five minutes to connect, using telnet, to my unix server from a PC.

What tools are available to help me understand how to diagnose my DNS configuration?

Cause

This is a DNS Name Resolution configuration issue.

Solution

DNS resolution:
--------------
To ensure that the DNS resolution is working, use the command, let's
start with the basics:
# ping <your_server.your_domain>
# traceroute <your_server.your_domain>
(Some internet sites prevent this from working and a 'default'
 route will be needed if you attempt to access a site outside of
 your known network).

to get an idea of the delays and see if you observe the same problems if you specify an IP address, see below for further options.

To start with some DNS tools though:

# nslookup <your_server.your_domain>
nslookup is a DNS client utility which can be run on both server
and clients. It will check the integrity of your /etc/resolv.conf
if you run it on the server.  If you run it from a PC client you
can check that the server has a correct DNS entry.
There are also the debugging tools:
# dig <your_server.your_domain> any
or:
# host <your_server.your_domain>

Later versions of BIND prefer the use of "dig" rather than "nslookup" as you may see "nslookup" reporting:

Note:  nslookup is deprecated and may be removed from future
releases.  Consider using the `dig' or `host' programs instead.
Run nslookup with the `-sil[ent]' option to prevent this message
from appearing.
# nslookup <public.domain>
Server:         1.2.3.4
Address:        1.2.3.4#53
** server can't find <public domain>.<my domain>: REFUSED

means that the DNS server is refusing access to it's DNS services.

and:
# traceroute -n <your_server.your_domain>

(Traceroute will indicate networking delays with a "*".)

and:
# ping -rn <IP-Address>
where:
-r  Bypass the normal routing tables and send directly to a
    host on an attached network.
-n  Numeric output only.  No attempt will be made to look up
    symbolic names for host addresses.

Failure of any of these debugging tools would indicate a name resolution problem on the server(s) containing DNS information about your server or a general network routing problem.

For OpenServer6/UnixWare7/Open UNIX 8: (SVR5 ABI's)
-------------------------------------
To check the host resolution order of your server, check the file:
/etc/netconfig

The tcp line below shows that hosts are resolved locally first, within /etc/hosts, and then by DNS.

tcp     tpi_cots_ord    v       inet    tcp     /dev/tcp
/usr/lib/tcpip.so,/usr/lib/resolv.so
For OpenServer5 and OpenServer6: (which use OSR5 ABI's)
-------------------------------
To check the host resolution order of your server, check the file:
/etc/resolv.conf

and ensure the line "hostresorder local bind" is in place to resolve names in /etc/hosts first then to use bind.

/etc/resolv.conf:
----------------
An example /etc/resolv.conf would read as:
domain uk.sco.com
nameserver 10.10.10.1
nameserver 10.10.10.2
search uk.sco.com
If you only have one NameServer, the resolver will query it with a 5
second timeout.  If it receives an ICMP port or host unreachable
error, it doubles the 5 seconds and tries again.

It will retry 4 times, 5 sec., 10 sec, 20 sec. for a total of 35 seconds (assuming first query had an icmp eror time of 0 which is unlikely so its probably really 36-37 seconds) then fall back to hosts.

If it times out on even one query, it returns a null response and does not fall back.

If you have two or more NameServers specified; If the resolver either times out or gets an error from the first NameServer, it queries the second NameServer. If it times out on all NameServers it changes the retry to int(10/number of servers)

So two NameServers - second retry is 5 seconds, 3 NameServers, 3
seconds etc.  Subsequent queries double the retry and continue.

This may take up to 75 seconds total for BIND versions before 8.2.1

In BIND 8.2.1 and later, there is only one retry cycle so this is a maximum of 24 seconds.

If all servers timeout, a null response is returned.

You can tweak the resolver's behaviour by adding options to:

/etc/resolv.conf
options attempts:4

Controls the number of retry attempts before fallback or failure

options timeout:2

Controls the initial timeout value, so this will decrease your overall time

options rotate
In addition, if you have access to the Internet then try a public
provider.  For example, Google use 8.8.4.4 where ping, traceroute
and access to the DNS port (53) will work.
Check Hosts:
-----------
To check that your /etc/hosts file is correctly configured, make
sure that the /etc/hosts file does not contain duplicate names or
IP addresses. It should be in this format:
XXX.YYY.XXX.YYY your_server.fully_qualified_name your_server
Example:  150.126.xxx.yyy server.sco.com  server
Turn off DNS:
------------
To identify where the problem is, DNS on the server
should first be de-activated. To do this, run both:
scoadmin "DNS Manager"
scoadmin "Client Manager"

and make sure there is no configuration defined there or you have a simplier DNS client configuration then:

# mv /etc/resolv.conf /etc/resolv.conf.orig
Then reboot your server.

If you get error messages, such as:

"Failure to load the sco_Tcl_osa type OSA"
"TclError: Unknown message ID `SCO_DNS_ERR_UNIX'"
it indicates that the configuration cannot be read because there
is a corrupted or missing file from the DNS configuration.  This
is likely to be a missing /etc/inet/named.d directory.
"FATAL ERROR: Unable to determine current configuration"

Failed to process the scoped request. General failure occurred in processing the request.

indicates that the configuration file db.cache or db.local is a corrupted or missing file from /etc/inet/named.d

"Configure as Caching Name Server Only"

Select "No" so that no configuration changes are made.

If you want to ignore these errors and remove DNS Services manually, type the following:

ndc stop
mkdir -p /local/dns
mv /etc/resolv.conf /local/dns
For UnixWare7/Open UNIX 8:
mv /etc/inet/named* /local/dns
For OpenServer:
mv /etc/named.d/* /local/dns
kill -9 <in.named PID>

This will ensure that no DNS services are currently running on your server.

For UnixWare7/Open UNIX 8:

To make sure that no DNS services will start when your server starts, edit /etc/inet/config and change the following line:

5:/usr/sbin/in.named::y:/etc/inet/named.conf::
to read as follows:
# 5:/usr/sbin/in.named::y:/etc/inet/named.conf::
For OpenServer:

Using your favorite editor, change /etc/tcp from:

#
# Name server should start before almost everything
#
if [ -x /etc/named  -a -x /etc/ndc ]; then
        if [ -f /etc/named.boot -o -f /etc/named.conf ]; then
                echo "named\n"
                /etc/ndc start
        fi
fi
to:
#
# Name server should start before almost everything
#
#if [ -x /etc/named  -a -x /etc/ndc ]; then
#        if [ -f /etc/named.boot -o -f /etc/named.conf ]; then
#                echo "named\n"
#                /etc/ndc start
#        fi
#fi

After rebooting the server, if the connection still takes five minutes then the problem is likely to be a name resolution on the Domain Name Server(s) for your organization.

If the server name or domain name has recently changed then you may
want to stop and start the DNS services on the Primary/Secondary Name
Servers.  This is relevant for Microsoft NT Server and NetWare.

To restart DNS services on your server, either configure DNS services using the scoadmin commands detailed above or put back the various files from /local/dns and restart the name server with this command:

ndc start
Check the /var/adm/syslog file for information regarding any error
messages and note the version of bind being used.  This will be
logged in /var/adm/syslog:
Feb  9 17:28:54 my_server named[2552]: starting.  named 8.1.2

Later versions support the "-v" option, eg:

# in.named -v
BIND 9.1.0

Error messages could indicate a problem with the DNS configuration.

If the delay continues then the problem has to be in the syntax of your existing DNS files.

For information on configuring these files, visit the UnixWare 7 online documentation at:

http://<your_server>:457
See the "Internet and Intranet" chapter.
NOTE:     From a Windows client, add the name of the server to the HOSTS file.
          For example, with Windows 2000 this will be found in:
c:\%systemroot%\system32\drivers\etc
NOTE:     .nslookuprc
          -----------
          To change the timeout values of "nslookup" run "nslookup" and enter:
> set all
You may see something like:
Set options:
nodebug         defname         search          recurse
nod2            novc            noignoretc      port=53
querytype=A     class=IN        timeout=5       retry=2
root=f.root-servers.net.
domain=uk.xxx.com
srchlist=uk.xxx.com
> set timeout=<no of secs>

To make this a permanent change, create a ".nslookuprc" in your $HOME directory containing the set commands you want, for example:

set timeout=1

The "man" page of "nslookup" incorrectly states the timeout is 10.

NOTE:     If your server is Internet facing then you might like to check your
          domain is being resolved correctly, for example visit a site like:
http://www.whois.net
http://www.mxtoolbox.com
http://ipadmin.junkemailfilter.com/rdns.php
http://reverseinternet.com/
NOTE:     Some examples:
          -------------
          Some applications will require a Reverse Name lookup, to resolve the
          name of the client connecting to it.  An example of which is UW7's
          and OSR6's wu-ftpd ftp daemon, configured by /etc/ftpaccess.

'proftpd', available from SCO's Skunkware is an example of a ftpd daemon which does not have a reverse name lookup, configured with "proftpd.conf":

UseReverseDNS off
IdentLookups off

'proftpd' is available for OpenServer6, for example, from:

ftp://ftp2.sco.com/pub/skunkware/osr6/vols/proftpd-1.3.1Sc-VOLS.cpio

Once un-cpio'ed and 'custom' installed from the VOL files you can see that proftpd is installed by using 'custom' -> Software -> Examine Files

You can change the proftpd.conf file in /usr/etc/proftpd.conf and it can be checked with:

/opt/K/SKUNKWARE/proftpd/1.3.0aSa/usr/sbin/proftpd -t
By default, latest versions of SCO Unix come with "openssh" which
will support 'sftp'.  An example of Windows client which will
support this protocol would be 'putty'.

He's an example though of what to expect using 'wu-ftpd':

Examples using 'ftp' from a Windows PC to SCO Unix Servers:

My /etc/resolv.conf is configured with "hostresorder local bind" and my /etc/netconfig is configured as:

tcp     tpi_cots_ord    v       inet    tcp     /dev/tcp
           /usr/lib/tcpip.so,/usr/lib/resolv.so

My /etc/resolv.conf is configured with a Primary and Secondary DNS server (nameserver) information.

Test 1:

If I connect using ftp with no /etc/resolv.conf present or no entry in the /etc/hosts file for the connecting PC:

Connection Time: 2-5 secs
Test 2:

If I connect using ftp with an entry in the /etc/hosts file for my connecting PC and have no /etc/resolv.conf file present then:

Connection Time: 0 secs
Test 3:

If I connect using ftp to any of the servers with a good working DNS entry in /etc/resolv.conf and regardless of the entry in /etc/hosts then:

Connection Time: 0 secs
Test 4:

If, however, I put an invalid DNS entry as the primary nameserver in /etc/resolv.conf simulating a downed DNS server while the second is still good and no entry in /etc/hosts for my connecting PC then my results are:

Connection Time: 15-25 secs
Test 5:

If I then put my PC into the /etc/hosts file for my connecting PC with an invalid DNS entry as the primary nameserver in /etc/resolv.conf simulating a downed DNS server while the second is still good then my results are improved with:

Connection Time: 10-15 secs
Test 6:

If I then reduce my DNS /etc/resolv.conf entries to one nameserver and this is faulty and regardless of the entry in /etc/hosts then we see a:

Connection Timed Out after a minute
NOTE:   BIND Issues:
        -----------
        Bind restricts the use of underscores in server names.

During the start of the server you may experience the following messages in 'syslog':

Feb  4 10:18:06 dnsserver in.named[1380]: dns_rdata_fromtext:
db.128.23:309: near 'underscored_server.domain.com.': bad name (check-names)
Feb  4 10:18:06 dnsserver in.named[1380]: zone 23.128.in-addr.arpa/IN:
loading from master file db.128.23 failed: bad name (check-names)

You can add a "check-names ignore;" to each of the zone entries in /etc/inet/named.conf, eg:

zone "domain.com" { type master; file "db.domain"; check-names ignore; };

The following parameters are also needed for Bind 9.4:

allow-recursion { any; }; allow-query { any; }; allow-query-cache { any; };

If you find that /usr/sbin/ndc fails then change the first line in the script:

From:
#!/bin/ksh
To:
#!/u95/bin/ksh

See also

     Latest Patch Releases:
     ---------------------
TA118482,"UnixWare 7.1.1 Maintenance Pack 2 Cover Letter and Installation
Instructions."

TA118182, "Open UNIX 8.0.0 Maintenance Pack 4 Coverletter and Installation instructions."

TA113822, "What is SLS ptf7705a, the UnixWare 7.1.1 BIND Version 8.2.3 supplement?"

For an explanation of what some of the DNS error messages mean refer:

TA110903, "What do the named statistics mean in /usr/adm/syslog?"

     TCP/IP Tuning:
     -------------
TA113164, "My application returns SOCKET accept failed [errno 126] when I try to open over 200 sockets every second."
dig(1Mtcp), nslookup(1Mtcp), traceroute(1Mtcp), named.d(1Mtcp),
ndc(1Mtcp), in.named(1Mtcp), host(admn)

DNS and BIND, 4th Edition O'Reilly Manual available at:

http://safari.oreilly.com/?XmlId=0-596-00158-4

From the Xinuos technical article database, record 112741. Reproduced with permission. The original is at www.sco.com/ta/112741, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.