Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #186927 > unrolled thread

Re: sudo slow on DNS lookup, with invalid resolv.conf entries

Started by"x9p" <debian-user@x9pneu.com>
First post2017-09-18 01:50 +0200
Last post2017-09-18 14:40 +0200
Articles 11 — 5 participants

Back to article view | Back to linux.debian.user


Contents

  Re: sudo slow on DNS lookup, with invalid resolv.conf entries "x9p" <debian-user@x9pneu.com> - 2017-09-18 01:50 +0200
    Re: sudo slow on DNS lookup, with invalid resolv.conf entries deloptes <deloptes@gmail.com> - 2017-09-18 09:10 +0200
      Re: sudo slow on DNS lookup, with invalid resolv.conf entries "x9p" <debian-user@x9pneu.com> - 2017-09-18 11:40 +0200
        Re: sudo slow on DNS lookup, with invalid resolv.conf entries Curt <curty@free.fr> - 2017-09-18 13:40 +0200
          Re: sudo slow on DNS lookup, with invalid resolv.conf entries Greg Wooledge <wooledg@eeg.ccf.org> - 2017-09-18 16:00 +0200
            Re: sudo slow on DNS lookup, with invalid resolv.conf entries Curt <curty@free.fr> - 2017-09-18 16:40 +0200
          Re: sudo slow on DNS lookup, with invalid resolv.conf entries "x9p" <debian-user@x9pneu.com> - 2017-09-18 17:30 +0200
            Re: sudo slow on DNS lookup, with invalid resolv.conf entries Brian <ad44@cityscape.co.uk> - 2017-09-18 18:10 +0200
              Re: sudo slow on DNS lookup, with invalid resolv.conf entries "x9p" <debian-user@x9pneu.com> - 2017-09-18 20:50 +0200
                Re: sudo slow on DNS lookup, with invalid resolv.conf entries Brian <ad44@cityscape.co.uk> - 2017-09-18 21:10 +0200
        Re: sudo slow on DNS lookup, with invalid resolv.conf entries Brian <ad44@cityscape.co.uk> - 2017-09-18 14:40 +0200

#186927 — Re: sudo slow on DNS lookup, with invalid resolv.conf entries

From"x9p" <debian-user@x9pneu.com>
Date2017-09-18 01:50 +0200
SubjectRe: sudo slow on DNS lookup, with invalid resolv.conf entries
Message-ID<uqRu1-6qe-1@gated-at.bofh.it>
> The last time I recollect this "someone" sticking his head above the
parapet was in the thread beginning at
>  https://lists.debian.org/debian-devel/2013/07/msg00809.html

>From the above URL:

From: Christoph Anton Mitterer <calestyo@scientia.net>
Date: Tue, 30 Jul 2013 22:43:44 +0200

-----
- The system hostname (and domainname if any) should ALWAYS be
resolvable, whether a network is up or not, regardless of which.
(Assuming that lo is always up, if not, many things break anyway.)

- "localhost" when added like this to /etc/hosts is basically like a TLD.
"localhost" is one of the reserved names, unlike ip6-localhost and friends
and unlike .localdomain.
...
...
...
Further, but this isn't the case anymore anyway,... we should not
generate localhost.localdomain.
...
...
...
-----

If system hostname should ALWAYS be resolvable, whether there is network
or no, the change in /etc/hosts
from (default in stretch):
127.0.0.1       localhost
to (my system):
127.0.0.1       localhost localhost.localdomain

is justifiable as it breaks (not literally break, just adds lot of delay)
to sudo in a non-networked environment.

x9p

[toc] | [next] | [standalone]


#186930

Fromdeloptes <deloptes@gmail.com>
Date2017-09-18 09:10 +0200
Message-ID<uqYlP-2Ut-11@gated-at.bofh.it>
In reply to#186927
x9p wrote:

> If system hostname should ALWAYS be resolvable, whether there is network
> or no, the change in /etc/hosts
> from (default in stretch):
> 127.0.0.1       localhost
> to (my system):
> 127.0.0.1       localhost localhost.localdomain
> 
> is justifiable as it breaks (not literally break, just adds lot of delay)
> to sudo in a non-networked environment.

This is the default from the last stretch install

$ cat /etc/hosts
127.0.0.1       localhost
127.0.1.1       fujitsu.mydomain    fujitsu

so if mydomain or localdomain is not working it will delay.

127.0.1.1       fujitsu fujitsu.mydomain

will not delay because fujitsu is the name of the machine.

in my case mydomain was added at installation time, because cable was
plugged in and the computer (fujitsu) got its IP via the dhcp server on the
local network.

IMO you should look deeper in your use case and see why you get invalid
setup. The problem might be somewhere else.

regards

[toc] | [prev] | [next] | [standalone]


#186939

From"x9p" <debian-user@x9pneu.com>
Date2017-09-18 11:40 +0200
Message-ID<ur0H2-4j6-69@gated-at.bofh.it>
In reply to#186930
>
> This is the default from the last stretch install
>
> $ cat /etc/hosts
> 127.0.0.1       localhost
> 127.0.1.1       fujitsu.mydomain    fujitsu
>
> so if mydomain or localdomain is not working it will delay.
>
> 127.0.1.1       fujitsu fujitsu.mydomain
>
> will not delay because fujitsu is the name of the machine.
>
> in my case mydomain was added at installation time, because cable was
> plugged in and the computer (fujitsu) got its IP via the dhcp server on
> the
> local network.
>
> IMO you should look deeper in your use case and see why you get invalid
> setup. The problem might be somewhere else.
>
> regards
>
>

My chosen machine name was "localhost", problem partially lies here.

x9p

[toc] | [prev] | [next] | [standalone]


#186943

FromCurt <curty@free.fr>
Date2017-09-18 13:40 +0200
Message-ID<ur2z8-5Ip-35@gated-at.bofh.it>
In reply to#186939
On 2017-09-18, x9p <debian-user@x9pneu.com> wrote:
>>
>> IMO you should look deeper in your use case and see why you get invalid
>> setup. The problem might be somewhere else.
>>
>> regards
>>
>>
>
> My chosen machine name was "localhost", problem partially lies here.

Yeah, man. 

My uncle Harry had a similar problem when it occurred to him that--for
reasons of simplicity and because of a failing memory--he might christen
two recently-purchased kittens with identical names. Whenever he called
one of them there would be a considerable delay (each of them assuming
he was calling the other).

Of course cats never come when you call them anyway (which is a clue
the story may be apocryphal). 

BTW, did you get the memo?

http://www.ietf.org/rfc/rfc1912.txt


> x9p
>
>
>


-- 
"Time flies like an arrow. Fruit flies like a banana." Groucho

[toc] | [prev] | [next] | [standalone]


#186950

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2017-09-18 16:00 +0200
Message-ID<ur4KD-70P-51@gated-at.bofh.it>
In reply to#186943
On Mon, Sep 18, 2017 at 11:38:05AM +0000, Curt wrote:
> On 2017-09-18, x9p <debian-user@x9pneu.com> wrote:
> > My chosen machine name was "localhost", problem partially lies here.
> 
> Yeah, man. 
> 
> My uncle Harry had a similar problem when it occurred to him that--for
> reasons of simplicity and because of a failing memory--he might christen
> two recently-purchased kittens with identical names. Whenever he called
> one of them there would be a considerable delay (each of them assuming
> he was calling the other).
> 
> Of course cats never come when you call them anyway (which is a clue
> the story may be apocryphal). 

The story makes more sense in this context if your uncle names his
kitten "Me".

Uncle Harry: "Have you seen Me?"
Aunt Berta: "You're standing right there."
Harry: "Not me.  Me."
Berta; "Have you been drinking the rubbing alcohol again?"

[toc] | [prev] | [next] | [standalone]


#186952

FromCurt <curty@free.fr>
Date2017-09-18 16:40 +0200
Message-ID<ur5nj-7uE-1@gated-at.bofh.it>
In reply to#186950
On 2017-09-18, Greg Wooledge <wooledg@eeg.ccf.org> wrote:
> On Mon, Sep 18, 2017 at 11:38:05AM +0000, Curt wrote:
>> On 2017-09-18, x9p <debian-user@x9pneu.com> wrote:
>> > My chosen machine name was "localhost", problem partially lies here.
>> 
>> Yeah, man. 
>> 
>> My uncle Harry had a similar problem when it occurred to him that--for
>> reasons of simplicity and because of a failing memory--he might christen
>> two recently-purchased kittens with identical names. Whenever he called
>> one of them there would be a considerable delay (each of them assuming
>> he was calling the other).
>> 
>> Of course cats never come when you call them anyway (which is a clue
>> the story may be apocryphal). 
>
> The story makes more sense in this context if your uncle names his
> kitten "Me".

You're right. 

Your skit reminds me a little of "Who's on first?"

> Uncle Harry: "Have you seen Me?"
> Aunt Berta: "You're standing right there."
> Harry: "Not me.  Me."
> Berta; "Have you been drinking the rubbing alcohol again?"
>



-- 
"Time flies like an arrow. Fruit flies like a banana." Groucho

[toc] | [prev] | [next] | [standalone]


#186954

From"x9p" <debian-user@x9pneu.com>
Date2017-09-18 17:30 +0200
Message-ID<ur69I-82d-7@gated-at.bofh.it>
In reply to#186943
>>
>> My chosen machine name was "localhost", problem partially lies here.
>
> Yeah, man.
>
> My uncle Harry had a similar problem when it occurred to him that--for
> reasons of simplicity and because of a failing memory--he might christen
> two recently-purchased kittens with identical names. Whenever he called
> one of them there would be a considerable delay (each of them assuming
> he was calling the other).
>
> Of course cats never come when you call them anyway (which is a clue
> the story may be apocryphal).
>
> BTW, did you get the memo?
>
> http://www.ietf.org/rfc/rfc1912.txt
>
>

>From rfc1912:

-----
  Translating 127.0.0.1 into "localhost.dom.ain" can cause some
      software to connect back to the loopback interface when it didn't
      want to because "localhost" is not equal to "localhost.dom.ain".
-----

Thanks for the memo. Seems the solution is to not call machine localhost,
if insist in doing so, be sure it contains a "localhost.localdomain" line
in /etc/hosts.

I believe topic is closed with this.

Thanks

x9p

[toc] | [prev] | [next] | [standalone]


#186956

FromBrian <ad44@cityscape.co.uk>
Date2017-09-18 18:10 +0200
Message-ID<ur6Mp-8un-3@gated-at.bofh.it>
In reply to#186954
On Mon 18 Sep 2017 at 12:28:16 -0300, x9p wrote:

> Thanks for the memo. Seems the solution is to not call machine localhost,
> if insist in doing so, be sure it contains a "localhost.localdomain" line
> in /etc/hosts.
> 
> I believe topic is closed with this.

For the benefit of other users: what does your /etc/hosts look like now?

-- 
Brian.

[toc] | [prev] | [next] | [standalone]


#186965

From"x9p" <debian-user@x9pneu.com>
Date2017-09-18 20:50 +0200
Message-ID<ur9hg-1yZ-21@gated-at.bofh.it>
In reply to#186956
>>
>> I believe topic is closed with this.
>
> For the benefit of other users: what does your /etc/hosts look like now?
>
> --
> Brian.
>
>

root@localhost:~# cat /proc/sys/kernel/hostname
localhost.localdomain
root@localhost:~# grep localhost /etc/hosts
127.0.0.1       localhost localhost.localdomain
127.0.1.1       localhost
::1     localhost ip6-localhost ip6-loopback
root@localhost:~#

x9p

[toc] | [prev] | [next] | [standalone]


#186966

FromBrian <ad44@cityscape.co.uk>
Date2017-09-18 21:10 +0200
Message-ID<ur9AB-1Xw-9@gated-at.bofh.it>
In reply to#186965
On Mon 18 Sep 2017 at 15:41:48 -0300, x9p wrote:

> 
> >>
> >> I believe topic is closed with this.
> >
> > For the benefit of other users: what does your /etc/hosts look like now?
> >
> > --
> > Brian.
> >
> >
> 
> root@localhost:~# cat /proc/sys/kernel/hostname
> localhost.localdomain
> root@localhost:~# grep localhost /etc/hosts
> 127.0.0.1       localhost localhost.localdomain
> 127.0.1.1       localhost
> ::1     localhost ip6-localhost ip6-loopback

It is difficult to argue against success in solving a problem but I
wouldn't have 127.0.1.1 as localhost. Does 'cat /etc/hostname' also
give "localhost"?

-- 
Brian.

[toc] | [prev] | [next] | [standalone]


#186944

FromBrian <ad44@cityscape.co.uk>
Date2017-09-18 14:40 +0200
Message-ID<ur3vc-6je-9@gated-at.bofh.it>
In reply to#186939
On Mon 18 Sep 2017 at 06:32:55 -0300, x9p wrote:

(Please watch your attributioms; it confuses matters. x9p did not write
this).

> > This is the default from the last stretch install
> >
> > $ cat /etc/hosts
> > 127.0.0.1       localhost
> > 127.0.1.1       fujitsu.mydomain    fujitsu
> >
> > so if mydomain or localdomain is not working it will delay.
> >
> > 127.0.1.1       fujitsu fujitsu.mydomain
> >
> > will not delay because fujitsu is the name of the machine.
> >
> > in my case mydomain was added at installation time, because cable was
> > plugged in and the computer (fujitsu) got its IP via the dhcp server on
> > the
> > local network.
> >
> > IMO you should look deeper in your use case and see why you get invalid
> > setup. The problem might be somewhere else.
> >
> > regards
> 
> My chosen machine name was "localhost", problem partially lies here.

The hosts manual says each host should have a line like

  IP_address canonical_hostname [aliases...]

By implication the catonical_hostname should be for one IP_address. You
have (had?)

  root@localhost:~# grep localhost /etc/hosts
  127.0.0.1       localhost
  127.0.1.1       localhost

The first line is ok; the canonical_hostname localhost has the address
127.0.0.1. The second line is not ok.

The file /etc/hostname has the system hostname; it should not be
"localhost". If it was "stretch" then the second line should be

  127.0.1.1       stretch

(This becomes a little more complicated if a mail server is one of the
services being run on the machine).

-- 
Brian.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web