Interview Prep/Networking/Command-Line Tools & Diagnostics

How do you resolve a name the way the application does?

IntermediateConceptCommand-Line Tools & Diagnostics
Answer

Use getent, which follows nsswitch and the system resolver, unlike dig.

getent hosts api.internal
getent ahostsv4 example.com
resolvectl query api.internal

If dig works but getent fails, suspect /etc/nsswitch.conf, search domains, systemd-resolved routing per interface, or a stale nscd/sssd cache.

All Networking questions Roadmap: Networking for DevOps

More on Command-Line Tools & Diagnostics