nerdexam
CompTIA

LX0-103 · Question #172

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.. When netstat -a hangs, it is almost always because the tool is waiting for DNS to resolve IP addresses to hostnames before displaying output.

System Architecture

Question

Suppose that the command netstat a hangs for a long time without producing output. You might suspect:

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

(50 responses)
  • A
    10% (5)
  • B
    82% (41)
  • C
    2% (1)
  • D
    2% (1)
  • E
    4% (2)

Why each option

When `netstat -a` hangs, it is almost always because the tool is waiting for DNS to resolve IP addresses to hostnames before displaying output.

Aa problem with NFS.

NFS issues can cause hangs in file operations or mount-related commands, but would not specifically cause `netstat` to stall during hostname resolution.

Ba problem with DNS.Correct

By default, `netstat -a` attempts to resolve all numeric IP addresses in active connections and sockets to their corresponding hostnames using DNS. If the DNS resolver is unreachable or not responding, `netstat` blocks indefinitely waiting for each lookup to time out, producing no output until resolution completes or fails. Running `netstat -an` (with the `-n` flag to suppress resolution) would confirm this by returning immediately.

Ca problem with NIS.

NIS problems could affect user/group lookups but would not directly block the hostname resolution step that `netstat` performs via DNS.

Da problem with routing.

Routing problems would prevent packets from reaching destinations but `netstat` reads local kernel socket tables, so it would still produce output rather than hang.

Ethat the netstat daemon has crashed.

`netstat` is a stateless command-line utility, not a daemon, so there is no `netstat` daemon process that could crash.

Concept tested: DNS dependency in netstat hostname resolution behavior

Source: https://linux.die.net/man/8/netstat

Topics

#netstat#DNS resolution#network diagnostics#name lookup

Community Discussion

No community discussion yet for this question.

Full LX0-103 Practice