resolv.conf options not being honored

There's a hint about this on http://docstore.mik.ua/orelly/networking_2ndEd/dns/ch06_01.htm:

In other words, an instance of the resolver still queries the first name server in resolv.conf first, but for the next domain name it looks up, it queries the second name server first, and so on.

Note that many programs can't take advantage of this since most programs initialize the resolver, look up a name, then exit. Rotation has no effect on repeated ping commands, for example, because each ping process initializes the resolver, queries the first name server in resolv.conf, and then exits before using the resolver again. Each successive invocation of ping has no idea which name server the previous one used -- or even that ping was run earlier. But long-lived processes that send lots of queries, such as a sendmail daemon, can take advantage of rotation.


Since the 'dig' and 'host' commands only make one query, it is impossible for them to rotate their queries. Rotation requires a program that issues multiple queries. (It is literal rotation, not random distribution. The first query goes to the first server, the second to the second, and so on.)

Note that many programs can't take advantage of this since most programs initialize the resolver, look up a name, then exit. Rotation has no effect on repeated ping commands, for example, because each ping process initializes the resolver, queries the first name server in resolv.conf, and then exits before using the resolver again. Each successive invocation of ping has no idea which name server the previous one used -- or even that ping was run earlier. But long-lived processes that send lots of queries, such as a sendmail daemon, can take advantage of rotation. -- O'Reilly, DNS and Bind