AIX DNS rotate, timeout and attempts options
Back in 2009/10, I wrote a couple of blog
posts about some new (at the time) options for the resolv.conf file on
AIX 6.1. Now, some 15 years later, things haven’t changed a lot since then, but
an email I received from someone, asking about an issue with AIX DNS, prompted
me to re-visit the options and provide a new example of how to (potentially)
configure /etc/resolv.conf on your AIX systems.
The email said:
“We
performed some maintenance on our primary DNS server (hosted on another OS, not
AIX). We had hoped that the AIX resolver would automatically ‘fail over’ to the
secondary DNS server during the outage. And then automatically ‘fall back’ to
the primary DNS server when it was online again. We’d hoped that AIX would use
the nameserver entries in our /etc/resolv.conf file to determine
which name server to use. But this did not happen. And as a result, it impacted
our application. To work around the issue we temporarily removed the first name
server from the resolv.conf file. When the primary DNS server was online
again, we added it back.
# cat
/etc/resolv.conf
domain ibm.edu
search ibm.edu
nameserver
10.1.1.120
nameserver
10.1.1.121
nameserver
10.2.1.130
# tail
/etc/netsvc.conf
hosts
= local,bind4
# oslevel
-s
7300-01-02-2320
Can you suggest how we could
configure our resolv.conf to handle this type of situation better?
Thanks!”
My response was:
Based on your current resolv.conf file,
the DNS behaviour you described is working as expected, because you haven't
configured name server rotation. Typically, the resolver sends
the DNS queries to the first name server only, unless you explicitly configure
the name server rotation option. For example:
domain ibm.edu
search ibm.edu
nameserver
10.1.1.120
nameserver
10.1.1.121
nameserver
10.2.1.130
options rotate
options timeout:1
options attempts:1
With the options above, the resolver waits for 1 second (timeout) for the DNS query before it moves to the next one in the list, after
one DNS query attempt (attempts). The same behaviour repeats for the rest of the name servers (rotate).
Here are some useful links that discuss AIX,
DNS, resolv.conf, rotate, timeout and attempts options.
https://www.ibm.com/docs/en/aix/7.3?topic=formats-resolvconf-file-format-tcpip
http://gibsonnet.net/blog/cgaix/html/AIX%206.1%20resolv.conf%20and%20netcd..html
http://gibsonnet.net/blog/cgaix/html/New%20resolv.conf%20options%20in%20AIX%206.1.html
https://www.ibm.com/support/pages/ibm-aix-behavior-host-name-resolution
https://keymon.wordpress.com/2010/03/09/the-weird-domain-name-resolution-mechanism-on-aix/