The question that comes to mind is why are the internal and external DNS Servers on the same subnet?
I guess you must have some reason for this, but this unexpected setup is probably confusing whatever heuristics are employed in determining which are internal and which external and that that in turn leads to all three being fed into the sort process with the consequence that the lowest numbered one comes out on top.
c.f. host.conf (5)
Quote:
reorder
Valid values are on and off. If set to on, resolv+ will attempt to reorder host addresses so that local addresses (i.e., on the same subnet) are listed first when a gethostbyname(3) is performed. Reordering is done for all lookup methods. The default value is off.
|
and resolv.conf (5)
Quote:
On a normally configured system this file should not be necessary...
sortlist
Sortlist allows addresses returned by gethostbyname(3) to be sorted. A sortlist is specified by IP address netmask pairs. The net‐
mask is optional and defaults to the natural netmask of the net. The IP address and optional network pairs are separated by
slashes. Up to 10 pairs may be specified. E.g., sortlist 130.155.160.0/255.255.240.0 130.155.0.0
|
I was looking for the system call that does the stacking and the unstacking of the resolv.confs, but it doesn't seem to be installed on this (ubuntu) box and so there is no man page entry for it. But I recall its behaviour being initially very confusing when playing with PPP.