Live data from Hacker News

The Sisyphean Task of DNS Client Config on Linux

tailscale.com

1–10 of 86 posts

Re: The Sisyphean Task of DNS Client Config on Linux

#3
post #2

The most interesting takeaway from this article is that, according to people who actually do the work, NetworkManager and systemd-resolved do get things right.

one reason resolv.conf is/was so sticky is that gethostbyname (and friends) is a libc thing and pretty low-level

Re: The Sisyphean Task of DNS Client Config on Linux

#5
post #2

The most interesting takeaway from this article is that, according to people who actually do the work, NetworkManager and systemd-resolved do get things right.

one reason resolv.conf is/was so sticky is that gethostbyname (and friends) is a libc thing and pretty low-level

Problem is, modern browsers do things differently yet again. So the insanity continues, just on different levels.

Re: The Sisyphean Task of DNS Client Config on Linux

#6

Where does /etc/nsswitch.conf factor in? I don't see it mentioned.

It’s probably omitted as nsswitch doesn’t affect DNS client configuration.

It affects which sources are consulted to lookup a name (including maybe asking DNS), but it doesn’t configure things like which DNS servers to ask or what options to set.

> The Name Service Switch (NSS) configuration file, /etc/nsswitch.conf, is used by the GNU C Library and certain other applications to determine the sources from which to obtain name-service information in a range of categories, and in what order.

Re: The Sisyphean Task of DNS Client Config on Linux

#7
If you are just trying to use curl or some other straightforward small application - this is enough. But running Kubernetes, docker, or some other container system? This mess is much more deep...

For example: there are known issues with systemd-resolved & Kubernetes (at least on Ubuntu that defaults to systemd-resolved) https://kubernetes.io/docs/tasks/administer-cluster/dns-debu...

Re: The Sisyphean Task of DNS Client Config on Linux

#9

Where does /etc/nsswitch.conf factor in? I don't see it mentioned.

nsswitch.conf tells it whether to consult `/etc/hosts` (`hosts: files`), `/etc/resolv.conf` (`hosts: dns`), or systemd-resolved (`hosts: resolve`); and if multiple of those, in what order (`hosts: first second third...`).

Re: The Sisyphean Task of DNS Client Config on Linux

#10
post #6

Where does /etc/nsswitch.conf factor in? I don't see it mentioned.

It’s probably omitted as nsswitch doesn’t affect DNS client configuration. It affects which sources are consulted to lookup a name (including maybe asking DNS), but it doesn’t configure things like which DNS servers to ask or what options to set. > The Name Service Switch (NSS) configuration file, /etc/nsswitch.conf, is used by the GNU C Library and certain other applications to determine the sources from which to ob…

nsswitch.conf is what tells it whether to use the traditional nss_dns (the thing that looks at /etc/resolv.conf), or whether to use the newer nss_resolve (the thing that talks to systemd-resolved).

So yeah, if the article is contrasting resolv.conf vs systemd-resolved, nsswitch.conf is how you select which of those approaches is used.

Post reply on HN