If your DNS config is broken, sudo will insert long pauses while it tries to do (often) unnecessary lookups for every command. Even "sudo ls" or "sudo whoami" will make a network call. This is because sudo is designed to support multiple different machine configurations from a single sudoers file, so knowing on which machine sudo is being run is important.
Many home users, however, just have one unique sudoers file per device, and when trying to fix your DNS, the timeouts can be a real problem.
So run visudo and put this in the sudoers file:
Define !fqdn
Save the file and sudo will not waste your time waiting for DNS lookups to timeout anymore.