5

I noticed that when I type sudo SomeCommand it hangs for a little. I started trying to figure out what was going on found one very strange thing: when I type tcpdump -i wlan0 and then do sudo, I get this:

IP Jebediah-PC.35662 > gateway.domain: 58284+ A? Jebediah-PC.
IP Jebediah-PC.35662 > gateway.domain: 62298+ AAAA? Jebediah-PC.
IP Jebediah-PC.45253 > gateway.domain: 22831+ PTR? 1.1.168.192.in-addr.arpa. 
IP gateway.domain > Jebediah-PC.35662: 58284 NXDomain 0/1/0
IP gateway.domain > Jebediah-PC.35662: 62298 NXDomain 0/1/0 
IP gateway.domain > Jebediah-PC.45253: 22831 NXDomain 0/1/0
IP Jebediah-PC.44842 > gateway.domain: 33078+ PTR? 103.1.168.192.in-addr.arpa.

It looks like some sort of DNS lookup. Here is a wireshark screenshot: screenshot

4
  • just to make it clear , "Jebediah-PC" and "galaxy-s2" are the same machine Jan 9, 2017 at 6:30
  • In this instance, what is the someCommand? Jan 9, 2017 at 10:44
  • sudo by itself should return a usage error. What did you actually enter that triggered this DNS lookup? Jan 9, 2017 at 10:55
  • 1
    One can trigger this problem with a mere sudo true, roaima. I've experienced sudo's sensitivity to unavailable or slow proxy DNS service, myself.
    – JdeBP
    Jan 9, 2017 at 12:04

2 Answers 2

5

Because sudo rules can specify a hostname, sudo has to resolve the hostnames of the local interfaces (so that it can tell if you're matching a host-specific rule). As the other Jeff S. said, this is likely because /etc/hosts doesn't contain "Jebediah-PC", and so you have to wait for the DNS lookups to fail.

0

My reputation is too low to leave a comment so this is more of a comment than an answer.

Since you state Jebediah-PC and galaxy-s2 are the same machine, it looks like it may have to do with changes to your hostname - see the below posts.

https://serverfault.com/a/41820

http://www.linuxquestions.org/questions/linux-newbie-8/fedora-11-sudo-has-a-20-second-start-delay-732291/#post3575840

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .