Bug 916 - Defer host name lookup
Defer host name lookup
Status: RESOLVED WORKSFORME
Product: Sudo
Classification: Unclassified
Component: Sudo
1.8.30
All All
: low enhancement
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-02-10 01:29 MST by Matthias Urlichs
Modified: 2020-02-10 05:45 MST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Urlichs 2020-02-10 01:29:41 MST
Using sudo to fix a network connection may take a long time, as sudo uses said network connection for its host name lookup.

It should either defer lookup until it actually needs a host name, or set a flag after scanning the rules file: host name lookup should be skipped when there are only rules which use "ALL" as the host name.
Comment 1 Todd C. Miller 2020-02-10 05:17:51 MST
Sudo doesn't do DNS lookups by default unless the fqdn flag is set.  However, some systems like Debian do hard-code this as a default value.  If you have a line like the following in sudoers, does it help?

Defaults !fqdn
Comment 2 Matthias Urlichs 2020-02-10 05:45:37 MST
Ah. That explains it. Thanks, I'll dropkick our admins into adding that line.