Bug 916

Summary: Defer host name lookup
Product: Sudo Reporter: Matthias Urlichs <matthias>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED WORKSFORME    
Severity: enhancement    
Priority: low    
Version: 1.8.30   
Hardware: All   
OS: All   

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.