LFCS · Question #772
Suppose that the command netstat a hangs for a long time without producing output. You might suspect:
The correct answer is B. a problem with DNS. The netstat -a command hangs because it attempts to resolve IP addresses to hostnames by default, and a slow or unresponsive DNS server can delay this process indefinitely.
Question
Options
- Aa problem with NFS.
- Ba problem with DNS.
- Ca problem with NIS.
- Da problem with routing.
- Ethat the netstat daemon has crashed.
How the community answered
(40 responses)- A3% (1)
- B90% (36)
- C5% (2)
- E3% (1)
Why each option
The `netstat -a` command hangs because it attempts to resolve IP addresses to hostnames by default, and a slow or unresponsive DNS server can delay this process indefinitely.
NFS problems typically affect file access, not the ability of `netstat` to list network connections, although NFS issues might show up in `netstat` output if connections are stuck.
The `netstat -a` command, when run without the `-n` option, attempts to resolve numeric IP addresses into human-readable hostnames for all active connections and listening ports. If the configured DNS server is unreachable or experiences significant latency, this name resolution process will time out, causing the `netstat` command to hang or take an extended period to produce output while it waits for DNS queries to complete.
NIS issues relate to centralized user and group information, which does not directly cause `netstat` to hang when listing network connections.
Routing problems would prevent network traffic from reaching its destination, but `netstat` can still display the connections it sees or attempts to make, without necessarily hanging due to routing itself.
`netstat` is a command-line utility, not a daemon or background service, so it does not crash in the manner a daemon would; it simply executes and exits, or waits indefinitely if blocked.
Concept tested: Network troubleshooting with netstat and DNS
Source: https://man7.org/linux/man-pages/man8/netstat.8.html
Topics
Community Discussion
No community discussion yet for this question.