Why does dns resolution still works on my linux coreos server with an empty an resolv.conf?

507 views
Skip to first unread message

Vincent Fiset

unread,
Aug 17, 2018, 12:33:26 PM8/17/18
to CoreOS User
I am on a coreos 1353.8.0 host, I need help understanding why dns resolution still work with nothing in my /etc/resolve.conf and related files...

If I test the same scenario on a debian host, as soon as I remove the nameservers in the resolv.conf file I loose dns resolution.

here is what I did:

myhost ~ # cat /etc/resolv.conf
#nameserver 10.1.2.3
#nameserver 10.1.2.4
#nameserver 10.1.2.5

myhost
~ # cat /run/systemd/resolve/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known DNS servers.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
# No DNS servers known.

myhost
~ # cat /etc/nsswitch.conf
# /etc/nsswitch.conf:

passwd
:      files usrfiles sss
shadow
:      files usrfiles sss
group:       files usrfiles sss

hosts
:       files usrfiles dns myhostname
networks
:    files usrfiles dns

services
:    files usrfiles
protocols
:   files usrfiles
rpc
:         files usrfiles

ethers
:      files
netmasks
:    files
netgroup
:    files
bootparams
:  files
automount
:   files
aliases
:     files

myhost
~ # ping internal.hostname
PING
internal.hostname (10.100.1.1) 56(84) bytes of data.
64 bytes from 10.100.1.1: icmp_seq=1 ttl=64 time=0.256 ms
^C
--- internal.hostname ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min
/avg/max/mdev = 0.256/0.256/0.256/0.000 ms
Enter code here...







strace ping:

myhost ~ # strace -s 2048 -f -o /tmp/str ping internal.hostname
PING
internal.hostname (10.100.1.1) 56(84) bytes of data.
64 bytes from 10.100.1.1: icmp_seq=1 ttl=64 time=0.131 ms
^C
--- internal.hostname ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min
/avg/max/mdev = 0.131/0.131/0.131/0.000 ms
myhost
~ # grep open /tmp/str
21453 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
21453 open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
21453 open("/etc/resolv.conf", O_RDONLY|O_CLOEXEC) = 4
21453 open("/etc/resolv.conf", O_RDONLY|O_CLOEXEC) = 4
21453 open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 4
21453 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 4
21453 open("/lib64/libnss_files.so.2", O_RDONLY|O_CLOEXEC) = 4
21453 open("/etc/host.conf", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
21453 open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 4
21453 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 4
21453 open("/lib64/libnss_usrfiles.so.2", O_RDONLY|O_CLOEXEC) = 4
21453 open("/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 4
21453 open("/usr/share/baselayout/hosts", O_RDONLY|O_CLOEXEC) = 4
21453 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 4
21453 open("/lib64/libnss_dns.so.2", O_RDONLY|O_CLOEXEC) = 4
21453 open("/lib64/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 4
21453 open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 4
21453 open("/usr/share/baselayout/hosts", O_RDONLY|O_CLOEXEC) = 4
21453 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 4
21453 open("/lib64/libnss_myhostname.so.2", O_RDONLY|O_CLOEXEC) = 4
21453 open("/lib64/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 4
21453 open("/lib64/libcap.so.2", O_RDONLY|O_CLOEXEC) = 4
21453 open("/lib64/librt.so.1", O_RDONLY|O_CLOEXEC) = 4
21453 open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 4
21453 open("/lib64/libpcre.so.1", O_RDONLY|O_CLOEXEC) = 4
21453 open("/lib64/libattr.so.1", O_RDONLY|O_CLOEXEC) = 4


David Michael

unread,
Aug 17, 2018, 12:50:17 PM8/17/18
to Vincent Fiset, CoreOS User
On Fri, Aug 17, 2018 at 12:33 PM, Vincent Fiset <vfi...@gmail.com> wrote:
> I am on a coreos 1353.8.0 host, I need help understanding why dns resolution
> still work with nothing in my /etc/resolve.conf and related files...
>
> If I test the same scenario on a debian host, as soon as I remove the
> nameservers in the resolv.conf file I loose dns resolution.

It works as expected in current versions for me.

> here is what I did:

From the files pasted, I think it could still resolve the host if
you're running nscd.service, if you have the definitions in
/etc/hosts, or if you are running a local DNS service.

Thanks.

David

Vincent Fiset

unread,
Aug 17, 2018, 1:10:06 PM8/17/18
to CoreOS User
good god, I did not realized that there was a dnsmasq instance running on that machine! Thanks for shedding light on that.

cheers
Reply all
Reply to author
Forward
0 new messages