[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Weird resolver problem in Debian 8



Hello folks,
I came upon a weird problem with the resolver on Debian 8.

root@myserver:~# cat /etc/resolv.conf
search strul.nu
nameserver 192.168.10.20
nameserver 192.168.20.20
sortlist 192.168.20.0/255.255.254.0

root@myserver:~# grep -i hosts /etc/nsswitch.conf
hosts:          files dns

root@myserver:~# grep -i mailgw /etc/hosts
root@myserver:~#




Checking addresses in dns:

root@myserver:~# host mailgw.strul.nu
mailgw.strul.nu has address 192.168.10.11
mailgw.strul.nu has address 192.168.20.11

And ping works the way it is supposed to, every time I run it. That is,
it uses the address suggested by the sortlist:

root@myserver:~# ping mailgw.strul.nu
PING mailgw.strul.nu (172.26.20.11) 56(84) bytes of data.
64 bytes from mailgw10.strul.nu (172.26.20.11): icmp_seq=1
ttl=64 time=0.132 ms
64 bytes from mailgw10.strul.nu (172.26.20.11): icmp_seq=2
ttl=64 time=0.133 ms

Same result regardless of how many times I run it. Great,
but telnet, however, chooses one of the a records at "random".


root@myserver:~# telnet mailgw.strul.nu smtp
Trying 172.26.20.11...
Connected to mailgw.strul.nu.
Escape character is '^]'.
220 mailgw10.strul.nu ESMTP

....

root@myserver:~# telnet mailgw.strul.nu smtp
Trying 172.26.10.11...


Anyone experienced something similar, or know what could be wrong?
In my head this should be handled by libc both for telnet and ping, so
the behavior should be the same?
Also, of course "telnet" in this case isn't really the problem, it's
just an example. The problem in this case is exim4, which behaves like
telnet, not like ping.

Regards
Torbjorn


Reply to: