You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having myhostname after dns/resolve in nsswitch.conf presents the following problems:
If /etc/hosts is empty/nonexistent, querying for localhost will ask dns first, which does not seem reasonable.
Querying for *.localhost will always ask dns first.
Querying the local configured hostname or any subdomain will query dns first.
Plenty of programs want to know the fqdn, so if the connection is flaky/slow but not dead you get (possibly very long) delays in resolving it.
The manpage suggests problem 3 is by design, but then if I'm using a local dns to resolve local hostnames, why do I want myhostname for?
I think myhostname should be recommended to be configured before dns, and note problem 3 in the manpage so that people can move it last if they need to. I can prepare a PR if you think the change should be made.
The text was updated successfully, but these errors were encountered:
I was wondering about that too (and actually disabled myhostname again as it causes some 10 second lag when resolving local host addresses). IIRC myhostname is essentially a dynamic replacement for /etc/hosts, isn't it? Shouldn't it follow right after files then, even before mdns4_minimal and particularly before dns?
Note that I do see why we recommend putting mymachines last in the list, but IMHO in the case of collision you want dns to win, while the local host name should always be defined, well, locally :) This particularly applies to localhost, localhost.localdomain, etc.
Is there a particular reason why it should follow dns and thus make it subject to achingly long delays?
I am pretty sure many people rely that "hostname --fqdn" returns the fqdn of the system. Hence the local hostname should be resolved via DNS first really, because otherwise "hostname --fqdn" will always return the nss-myhostname resolved hostname, i.e. the actual system hostname. The only way how to my nss-myhostname two modules, one htat resolves the local hostname, and is done after dns, and one that resolves "localhost", and is placed before dns.
Note that resolved removes the issues around this, as it refuses to resolve localhost via DNS. In fact, I am pretty sure that's the right way to go here...
Having myhostname after dns/resolve in nsswitch.conf presents the following problems:
/etc/hosts
is empty/nonexistent, querying forlocalhost
will ask dns first, which does not seem reasonable.*.localhost
will always ask dns first.The manpage suggests problem 3 is by design, but then if I'm using a local dns to resolve local hostnames, why do I want myhostname for?
I think myhostname should be recommended to be configured before dns, and note problem 3 in the manpage so that people can move it last if they need to. I can prepare a PR if you think the change should be made.
The text was updated successfully, but these errors were encountered: