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.
More on Command-Line Tools & Diagnostics
How do you check if a remote port is open?BeginnerHow do you list listening ports and the processes that own them?BeginnerWhat does `ping` tell you and what does it not?BeginnerHow does traceroute work and how do you read the output?BeginnerWhat is mtr and why is it better than traceroute?IntermediateHow do you query DNS with dig and read the answer?Beginner