Re: sudo slow on DNS lookup, with invalid resolv.conf entries
On Mon 18 Sep 2017 at 23:47:18 +0300, Reco wrote:
> On Mon, Sep 18, 2017 at 07:48:53PM +0100, Brian wrote:
> > On Mon 18 Sep 2017 at 20:13:44 +0200, deloptes wrote:
> >
> > > Reco wrote:
> > >
> > > > The question is - since 'localhost.localdomain' is special, what happens
> > > > if such hostname is chosen during the installation?
> > >
> > > well, now we all know what happens :)
> >
> > True, we know the OP has a problem with with sudo.
>
> That's what lie on surface. Any software that implements
> uname/gethostbyname sequence would exhibit similar behavior.
>
>
> > What we do not know
> > is the hostname he chose during the installation, although it looks like
> > it was "localhost" from the second line of
> >
> > 127.0.0.1 localhost
> > 127.0.1.1 localhost
>
> I agree.
>
> > The installer recommends a single word for the hostname. The "single"
> > aspect is the result of a number of years of experience and bug reports.
>
> And let's not forget RFC 952 (obsoleted by RFC 1123), which states:
>
> A "name" (Net, Host, Gateway, or Domain name) is a text string up to 24
> characters drawn from the alphabet (A-Z), digits (0-9), minus sign (-),
> and period (.). Note that periods are only allowed when they serve to
> delimit components of "domain style names".
>
> RFC 1123 lifts some restrictions:
>
> One aspect of host name syntax is hereby changed: the restriction on the
> first character is relaxed to allow either a letter or a digit. Host
> software MUST support this more liberal syntax.
>
> Host software MUST handle host names of up to 63 characters and SHOULD
> handle host names of up to 255 characters.
>
> But does not says anything about dots, so restrictions of RFC 952 still
> apply.
>
> > Although "localhost.localdomain" is not an invalid hostname
>
> I agree as long as 'invalid' is defined as 'kernel does not accept it'.
> For instance, one can set nodename as 'localhost.local' and watch avahi
> explode. Or, say, '_localhost', if one intends to wreak havoc in local
> DNS's SRV records.
> The kernel is surprisingly liberal at these things.
>
> > the OP does not appear to have used it. (We have not been given the
> > contents of his /etc/hostname explicitly).
>
> True. We also did not see the contents of sysctl.conf (and those *other*
> files that can store kernel tunables), custom init.d scripts and custom
> systemd units if there were any.
>
> To make things more confusing, 'localhost.localdomain' could be a
> 'transient' hostname, not a 'static' one (aka /etc/hostname).
>
> It's one of those things I prefer to debug with auditd on. Too many
> possibilities otherwise.
>
> > What was the problem with his resolv.conf? Have I missed that?
>
> OP used an unspecified VPN client which put an additional entry into
> /etc/resolv.conf on start, but failed to clean it up on stop.
Much clearer now. Your attention to explaining in detail is appreciated.
--
Brian.
Reply to: