Networking
Networking interview questions
Questions you may be asked in a Networking interview, each with an answer that explains the why. Read them, then take the Networking test to see how you do under a clock.
Practice first in a hands-on lab
DNS
After a migration, some users reach the new server at portal.example.com and others still hit the old one. You updated the A record two hours ago. How do you investigate?
This looks like caching or inconsistent authoritative data. First I would query the authoritative name servers directly. I would run
dig NS example.com, then dig @ns1.example.com portal.example.com and the same query against each other name server. I would also compare dig @nsX example.com SOA serials across them. If the servers disagree, zone transfer to a secondary is lagging or failing, for example because a NOTIFY was missed or the refresh interval hasn't elapsed. If they all agree on the new IP, the problem is caching. I would query a user's resolver with dig portal.example.com. The TTL shown is the time remaining in that resolver's cache. If it still returns the old IP with a large remaining TTL, repeat queries will show it counting down. The old record's TTL controls how long resolvers keep it. So if it was something like 86400, some resolvers can serve the old IP for up to a day. Ideally you lower the TTL well before a migration. Local hosts files, OS resolver caches and browser caches are also worth checking. The interviewer is listening for authoritative-versus-cached reasoning and TTL awareness.A user says intranet.example.com works for everyone else but gives 'server not found' on their laptop. How do you determine whether the problem is the laptop's DNS configuration or the record itself?
I would compare answers from different sources.
1. On the laptop, run
2. Query a known-good internal resolver directly, such as
3. If good resolvers answer but the laptop's resolver returns NXDOMAIN or times out, the laptop is using the wrong resolver. Common causes are bad DHCP/static DNS settings, a VPN pushing a different resolver, or split-horizon DNS where the laptop reaches only a public resolver that cannot see the internal zone. A stale negative cache on that resolver is another possibility.
4. If
- Use
- Check the hosts file.
- Flush the OS DNS cache.
- Check whether the browser is using its own DNS-over-HTTPS.
5. If every appropriate server fails, including the authoritative one, the record is missing or broken.
Comparing sources isolates which layer is at fault instead of guessing.
The interviewer is listening for:
- querying specific resolvers with
- reading the status and SERVER line
- knowing that
- separating client configuration from record problems
1. On the laptop, run
dig intranet.example.com (or nslookup / Resolve-DnsName on Windows). Note the status and the SERVER line to see which resolver it used.2. Query a known-good internal resolver directly, such as
dig @10.0.0.2 intranet.example.com. Then query the authoritative server too.3. If good resolvers answer but the laptop's resolver returns NXDOMAIN or times out, the laptop is using the wrong resolver. Common causes are bad DHCP/static DNS settings, a VPN pushing a different resolver, or split-horizon DNS where the laptop reaches only a public resolver that cannot see the internal zone. A stale negative cache on that resolver is another possibility.
4. If
dig succeeds on the laptop but the application still fails, the fault is in the local resolution path. dig bypasses that path, so test the OS resolver itself:- Use
getent hosts, Resolve-DnsName, or dscacheutil -q host.- Check the hosts file.
- Flush the OS DNS cache.
- Check whether the browser is using its own DNS-over-HTTPS.
5. If every appropriate server fails, including the authoritative one, the record is missing or broken.
Comparing sources isolates which layer is at fault instead of guessing.
The interviewer is listening for:
- querying specific resolvers with
dig @server- reading the status and SERVER line
- knowing that
dig bypasses the OS resolver, hosts file, and browser DNS- separating client configuration from record problems
After you change a DNS record, some users still reach the old server. Explain why this happens and how you would verify and handle it.
DNS answers are cached by resolvers for the record's TTL, so users behind different resolvers see the change at different times. If the old TTL was 24 hours, some caches may hold the old answer for up to a day. To verify, I query the authoritative server directly with
dig +norecurse app.example.com @ns1.example.com to confirm the new value, then query a few public and internal resolvers and compare. The TTL in each response counts down, which shows how long a cache will keep it. Client-side caches and hardcoded hosts file entries can also cause this. For future migrations, I lower the TTL a day or more beforehand, make the change, then raise it again. The interviewer is listening for an understanding of caching and TTL, checking authoritative versus recursive answers, and planning changes ahead rather than just waiting.Firewalls
A new internal API on a Linux server answers curl http://localhost:9000 fine, but a teammate on the same subnet gets 'No route to host' instead of a timeout. What does that wording suggest, and what do you check?
'No route to host' (EHOSTUNREACH) usually has one of two causes. Either something actively sent back an ICMP unreachable such as host-prohibited or admin-prohibited, or neighbor resolution (ARP) for the server failed.
The classic cause is a host firewall rule that REJECTs with an ICMP prohibited message. This is the default behavior of firewalld on RHEL-style servers when a port isn't opened. A silent DROP would give a timeout instead, and a reachable host with nothing listening would give 'Connection refused'.
On the server, I would check whether port 9000 is allowed:
-
-
On the client, I would run
Once the firewall is fixed, I would also run
The interviewer is listening for you to map the error wording to its cause: reject vs. drop vs. refused vs. ARP failure. They also want to see you check the firewall first, with the bind address as a follow-up.
The classic cause is a host firewall rule that REJECTs with an ICMP prohibited message. This is the default behavior of firewalld on RHEL-style servers when a port isn't opened. A silent DROP would give a timeout instead, and a reachable host with nothing listening would give 'Connection refused'.
On the server, I would check whether port 9000 is allowed:
-
sudo firewall-cmd --get-active-zones and sudo firewall-cmd --list-all --zone=<zone> to see the zone the interface is actually in.-
sudo nft list ruleset to see the raw rules. Modern firewalld uses nftables, so iptables -S may not show them.On the client, I would run
ip neigh to rule out an ARP failure, which shows up as an INCOMPLETE or FAILED entry.Once the firewall is fixed, I would also run
ss -tlnp on the server. This confirms the service listens on 0.0.0.0, [::], or the LAN IP, not only 127.0.0.1. A loopback-only bind wouldn't cause 'No route to host', but it would turn the next attempt into 'Connection refused'.The interviewer is listening for you to map the error wording to its cause: reject vs. drop vs. refused vs. ARP failure. They also want to see you check the firewall first, with the bind address as a follow-up.
You add a firewall rule to allow TCP 443 to a new server, but clients still time out. What do you check?
A timeout usually means packets are being dropped silently, not refused. A closed port or a REJECT rule normally gives 'connection refused' instead. So I focus on where packets are being dropped, while still ruling out the basics. I confirm the service is listening with
ss -tln and that it binds to a reachable address, not just 127.0.0.1. Then I test locally with curl to separate app problems from network ones. Next I check rule order, since an earlier deny or drop can match first. I also confirm the rule was applied to the right chain, zone, or interface and actually loaded. On the host firewall I check whether my rule gets hits: iptables -L -n -v shows packet counters, and with nftables the rule needs a counter statement for nft list ruleset to show hits. I also check any network or cloud firewall, security groups or NACLs, and the return path: routing, asymmetric paths, and stateful return traffic. Counters or a tcpdump capture on the server and along the path show where traffic stops. The interviewer is listening for: a layered approach, understanding timeout versus refused, rule order, and using counters or captures as evidence.A developer says their new service on port 5000 is reachable from the server itself but not from other machines in the office. The server runs Linux with firewalld enabled. How do you find and fix the problem?
First I confirm what address the service binds to with
ss -tlnp. If it shows 127.0.0.1:5000 (or [::1]:5000), the app is only listening locally, and the fix is in its config, not the firewall. If it shows 0.0.0.0:5000, [::]:5000/*:5000, or the server's LAN address, I check the firewall. firewall-cmd --get-active-zones shows which zone the LAN interface is in. Then firewall-cmd --zone=<zone> --list-all shows whether 5000/tcp, or a service covering it, is allowed there. If not, I add it with firewall-cmd --zone=<zone> --permanent --add-port=5000/tcp and then run firewall-cmd --reload. --permanent changes only the saved configuration, so the reload is what applies it to the running firewall. A change made without --permanent takes effect immediately but is lost on reload or reboot. I verify from another machine with nc -zv server 5000 or curl. Checking the bind address first matters because it separates an application problem from a filtering problem, so I don't change firewall rules needlessly. The interviewer is listening for: checking the listening address before touching the firewall, targeting the correct zone, knowing the permanent versus runtime distinction, and verifying from a remote client afterward.Firewalls and ports
A new web server is running and ss -tln shows it listening on 0.0.0.0:443, but external clients time out. How do you find out where the traffic is being dropped?
A timeout, rather than a refusal, suggests something is silently dropping packets, since a closed port would return a reset. The service is listening, so I check the layers between client and server. On the server I look at the host firewall, such as
nft list ruleset, iptables -L -n, or firewall-cmd --list-all. Then I run tcpdump -ni eth0 port 443 while a client tries. If SYN packets arrive but no reply leaves, the host firewall or routing is at fault. If nothing arrives, the drop is upstream: a network firewall, security group, NAT rule, or ACL. I also check return routing, because an asymmetric path can look like a timeout. The interviewer is listening for understanding the timeout versus refused distinction, using packet capture to locate the drop point, and checking both host and network firewalls.Firewalls and protocols
You can't SSH to a remote server. How do you tell whether the problem is the network, a firewall, or the SSH service itself?
1. Check reachability. I would run
2. Test the port directly. I use
- Refused: something actively answered. Usually the host is up but nothing is listening on 22 (service down or on another port). A firewall with a REJECT rule can produce the same result.
- Timeout: packets are being silently dropped or lost. This is typically a firewall DROP rule, but it can also be a routing problem or a host that is down.
3. Check authentication. If the connection opens but authentication fails, the verbose output shows key, user, or permission problems.
4. Confirm on the server side if possible. I would check
The why: each failure type points to a different layer, and narrowing from client to server isolates it.
The interviewer is listening for:
- distinguishing refused from timeout, including that firewalls can also reject;
- use of verbose output;
- awareness that a failed ping doesn't prove the host is down;
- a logical narrowing process.
ping and traceroute to see whether the host is reachable, remembering that ICMP is often blocked, so a failed ping doesn't prove the host is down.2. Test the port directly. I use
nc -zv host 22 or ssh -v user@host.- Refused: something actively answered. Usually the host is up but nothing is listening on 22 (service down or on another port). A firewall with a REJECT rule can produce the same result.
- Timeout: packets are being silently dropped or lost. This is typically a firewall DROP rule, but it can also be a routing problem or a host that is down.
3. Check authentication. If the connection opens but authentication fails, the verbose output shows key, user, or permission problems.
4. Confirm on the server side if possible. I would check
ss -tlnp | grep 22, systemctl status sshd, the local firewall rules, and the auth logs.The why: each failure type points to a different layer, and narrowing from client to server isolates it.
The interviewer is listening for:
- distinguishing refused from timeout, including that firewalls can also reject;
- use of verbose output;
- awareness that a failed ping doesn't prove the host is down;
- a logical narrowing process.
IP addressing and subnetting
You are asked to split 172.16.8.0/22 into four equal subnets for four office floors. What are the new subnets, and how many usable hosts does each have?
A /22 has 1024 addresses. Four equal subnets means borrowing 2 bits, giving /24 networks with 256 addresses each. The subnets are 172.16.8.0/24, 172.16.9.0/24, 172.16.10.0/24 and 172.16.11.0/24. Each has 254 usable hosts, because the network and broadcast addresses are reserved. I would check my work by confirming the last subnet ends at 172.16.11.255, which is the broadcast of the original /22. Equal splitting is simple, but I would also ask whether floors differ in size, since variable-length subnets can waste fewer addresses. The interviewer is listening for correct bit-borrowing logic, the minus-two host count, and a sanity check on the boundaries instead of guessing.
You are given 10.4.16.0/20 and asked to carve out subnets for departments needing 500, 200, and 50 hosts. How do you approach it, and what prefixes do you choose?
I allocate largest first so the blocks align cleanly. For 500 hosts I need 9 host bits (510 usable), so a /23. For 200 hosts I need 8 bits (254 usable), so a /24. For 50 hosts I need 6 bits (62 usable), so a /26. Starting at 10.4.16.0: the /23 is 10.4.16.0/23 (through 10.4.17.255), the /24 is 10.4.18.0/24, and the /26 is 10.4.19.0/26. That leaves 10.4.19.64 onward free for growth. Largest first avoids misaligned boundaries and wasted space. The interviewer is listening for: calculating host bits correctly, subtracting two for network and broadcast addresses, allocating in descending size, and leaving room to grow.
Ports and protocols
ss -tn on a busy web server shows thousands of connections in TIME_WAIT and a few hundred in ESTABLISHED. Is that a problem, and how do you decide?
Usually it is not a problem. TIME_WAIT is a normal state on the side that closes a TCP connection first. It holds the socket briefly so late packets are not mistaken for a new connection. Many short-lived HTTP connections naturally produce thousands of them. I would only worry if clients are seeing connection failures or errors like 'cannot assign requested address', which suggest ephemeral port exhaustion, mostly on a client or proxy making many outbound connections. Then I would check
ss -s, the ephemeral port range in /proc/sys/net/ipv4/ip_local_port_range, and whether keep-alive or connection pooling is enabled. The interviewer is listening for knowing TIME_WAIT is normal, tying concern to actual symptoms, and preferring fixes like connection reuse over blindly tuning kernel settings.Ports and sockets
You deploy a web service and curl http://localhost:8080 works on the server, but colleagues get a connection timeout from their laptops. What do you investigate?
Working on localhost means the app runs. The key clue is the timeout: if nothing were listening on the external address, for example because the app is bound only to 127.0.0.1, remote clients would normally get an immediate 'connection refused' (TCP RST). A timeout means packets are being silently dropped or never arrive.
I'd still do a quick check with
Then I focus on filtering and reachability:
- the host firewall (
- any cloud security group, network ACL, or corporate firewall in the path;
- whether colleagues are using the correct IP or hostname and the route to it is valid.
A tcpdump on the server (
The interviewer is listening for: interpreting timeout versus refused correctly, checking the bind address with ss, and considering firewalls at both host and network levels.
I'd still do a quick check with
ss -tlnp | grep 8080 to confirm it listens on 0.0.0.0, [::], or the server's IP rather than only loopback. A loopback-only bind is a real problem that would surface as 'refused' once the drop is fixed.Then I focus on filtering and reachability:
- the host firewall (
iptables -L -n, nft list ruleset, firewalld/ufw);- any cloud security group, network ACL, or corporate firewall in the path;
- whether colleagues are using the correct IP or hostname and the route to it is valid.
A tcpdump on the server (
tcpdump -ni any port 8080) shows whether their SYNs arrive at all. If no SYNs arrive, the drop is upstream. If SYNs arrive with no reply, the host is dropping them.The interviewer is listening for: interpreting timeout versus refused correctly, checking the bind address with ss, and considering firewalls at both host and network levels.
Routing and gateways
A Linux server can ping other hosts on its own subnet but cannot reach anything on the internet. What do you check, and in what order?
Same-subnet success means the interface and local link work, so I suspect routing. First I run
ip route to confirm a default route exists and points to the right gateway. Then I ping the gateway's IP to check it is reachable, and look at ip neigh to see if ARP resolved. If that works, I ping a public IP like 1.1.1.1 to test beyond the gateway, using traceroute to see where packets stop. Only after IP connectivity works would I test DNS with dig. The why: working outward layer by layer isolates the failing hop. The interviewer is listening for: checking the default route first, ordered reasoning, separating IP reachability from name resolution, and using traceroute output sensibly.A server has two network interfaces, one on a LAN and one on a management network. Users on a remote subnet can connect to it but replies seem to go out the wrong interface. What do you check?
This is asymmetric routing. The server receives traffic on one interface, but it picks the reply path from its own routing table, not from the interface the request arrived on. Often that means the reply leaves via the default gateway on the other network.
This causes two problems. Stateful firewalls in the path may drop the replies because they never saw the start of the connection. Strict reverse-path filtering, on the server or on routers, may drop the incoming packets because the route back to the source points out a different interface.
I would check:
-
-
-
-
-
The fix is usually one of two things:
- A specific static route for the remote subnet through the correct gateway.
- Policy routing: use
The interviewer is listening for:
- Using
- Understanding that replies follow the server's routing table.
- Knowing about policy routing and rp_filter.
This causes two problems. Stateful firewalls in the path may drop the replies because they never saw the start of the connection. Strict reverse-path filtering, on the server or on routers, may drop the incoming packets because the route back to the source points out a different interface.
I would check:
-
ip route to see the routing table.-
ip route get <client-ip> to see which interface and gateway the server picks for that client.-
ip route get <client-ip> from <server-ip-on-that-interface> if source-based rules are involved, to see the real reply path.-
ip rule to see any policy routing rules.-
net.ipv4.conf.all.rp_filter and net.ipv4.conf.<iface>.rp_filter with sysctl. The effective mode is the higher of the two values.The fix is usually one of two things:
- A specific static route for the remote subnet through the correct gateway.
- Policy routing: use
ip rule with a separate routing table per interface, so replies leave via the interface that owns the source address.The interviewer is listening for:
- Using
ip route get.- Understanding that replies follow the server's routing table.
- Knowing about policy routing and rp_filter.
A host has two interfaces, and traffic from a remote subnet arrives on one but replies leave through the other. Why does this break connections, and how would you fix it?
This is asymmetric routing. The host chooses the reply route by destination, usually its default route, so the reply leaves through a different interface and gateway than the request came in on. It often still carries the source IP of the receiving interface. This breaks connections in several ways. Stateful firewalls or NAT devices on either path see only half of the conversation and drop it. Upstream anti-spoofing filters may drop replies whose source address does not belong to that link. On Linux, strict reverse path filtering (
rp_filter=1) can drop the incoming packets themselves, because the route back to their source points out the other interface. I would confirm with ip route get <client IP> (or ip route get <client IP> from <local IP>) and tcpdump -i any host <client>. The fix is a more specific static route for the remote subnet via the correct gateway, or source-based policy routing with ip rule and a separate routing table per interface, so replies leave the interface they arrived on. I would avoid simply disabling rp_filter, or setting it to loose mode (2), without understanding why. The interviewer is listening for: naming asymmetric routing, using ip route get, and proposing specific routes or policy routing.Subnetting
A server has the address 10.20.30.77/26. What are the network address, the broadcast address, and the usable host range, and how would you check whether 10.20.30.130 is on the same subnet?
A /26 has 64 addresses per block, so blocks start at 0, 64, 128, 192. The address .77 falls in the 64 block, so the network is 10.20.30.64, the broadcast is 10.20.30.127, and usable hosts are .65 through .126. 10.20.30.130 sits in the 128 block (10.20.30.128/26), so it is on a different subnet and traffic between them must go through a router or gateway. The why: hosts decide locally versus gateway by applying the mask. The interviewer is listening for: confident block-size math without a calculator, correct network and broadcast edges, and the link between subnet membership and routing behavior.
You're handed 10.20.0.0/22 and asked to design subnets for three offices needing roughly 250, 120, and 60 hosts. How do you approach it, and why not just give each office a /24?
I size each subnet by usable hosts, which is 2^n minus 2, and sort largest first. 250 hosts needs a /24 (254 usable). 120 needs a /25 (126 usable). 60 needs a /26 (62 usable). I allocate in order so they align on boundaries: 10.20.0.0/24, 10.20.1.0/25, and 10.20.1.128/26. That leaves 10.20.1.192/26 and all of 10.20.2.0/23 free for growth. Giving every office a /24 would waste addresses and consume the block quickly, and it leaves less room to summarize routes or add sites later. I would also leave headroom, since a 250-host office on a /24 has almost no growth space and might deserve a /23. The interviewer is listening for correct host math, largest-first allocation, boundary alignment, and thinking about future growth rather than only the arithmetic.
Troubleshooting methodology
A user reports that a file share at files.corp.example.com is unreachable from their desktop, but it worked yesterday. Walk me through your first five minutes of troubleshooting.
First I scope and gather facts before touching anything. Is it only this user, only this share, or many people? What exactly is the error? What changed since yesterday, such as a patch, a password change, a DHCP or DNS change, a VPN, or a firewall rule?
Then I work up the stack from the desktop:
1. **Address and gateway.** I run
2. **Local path.** I ping the gateway. I keep in mind that ICMP can be filtered, so a failed ping is a clue, not proof.
3. **Name resolution.** I check that the name resolves and to what IP:
- On Windows:
- On Linux:
- I also compare with what the OS resolver returns, since the hosts file or a stale cache can differ from a direct DNS query.
4. **Reachability and the service itself.** If the name resolves, I check that IP and test the actual SMB port:
- On Windows:
- On Linux:
- This is the deciding test, because ping may be blocked.
Each result isolates the fault to the local host, the network path or routing, DNS, or the server and service. If the port is open, I move to authentication and permissions.
Going in order keeps me from guessing. The interviewer is listening for:
- a structured, layered approach;
- scoping and asking what changed first;
- the right tool at each step, including awareness of its limits.
Then I work up the stack from the desktop:
1. **Address and gateway.** I run
ipconfig /all on Windows, or ip addr and ip route on Linux, to confirm a valid address, gateway, and DNS servers.2. **Local path.** I ping the gateway. I keep in mind that ICMP can be filtered, so a failed ping is a clue, not proof.
3. **Name resolution.** I check that the name resolves and to what IP:
- On Windows:
Resolve-DnsName or nslookup.- On Linux:
dig.- I also compare with what the OS resolver returns, since the hosts file or a stale cache can differ from a direct DNS query.
4. **Reachability and the service itself.** If the name resolves, I check that IP and test the actual SMB port:
- On Windows:
Test-NetConnection IP -Port 445.- On Linux:
nc -zv IP 445.- This is the deciding test, because ping may be blocked.
Each result isolates the fault to the local host, the network path or routing, DNS, or the server and service. If the port is open, I move to authentication and permissions.
Going in order keeps me from guessing. The interviewer is listening for:
- a structured, layered approach;
- scoping and asking what changed first;
- the right tool at each step, including awareness of its limits.
Troubleshooting tools
Users say a web app is slow. How would you use curl to work out whether the delay is DNS, the connection, TLS, or the server itself?
I would use curl's timing variables:
- **DNS:** a large time_namelookup points to DNS.
- **Connection:** a big gap between namelookup and connect is the TCP handshake. It suggests network latency or packet loss.
- **TLS:** a big gap between connect and appconnect means slow TLS negotiation.
- **Server:** a long wait between appconnect (or pretransfer) and starttransfer means the server is slow producing the first byte. This gap still includes one round trip, so I compare it with the connect time.
- **Download:** the gap between starttransfer and total is the time to transfer the body.
I would repeat the test several times and from another network to rule out noise. The interviewer is listening for: knowing the timing fields are cumulative, mapping each gap to the right layer, and repeating measurements rather than trusting one run.
curl -o /dev/null -s -w 'dns:%{time_namelookup} connect:%{time_connect} tls:%{time_appconnect} pretransfer:%{time_pretransfer} firstbyte:%{time_starttransfer} total:%{time_total}\n' https://app.example.com. The values are cumulative from the start of the request, so I look at the differences between them:- **DNS:** a large time_namelookup points to DNS.
- **Connection:** a big gap between namelookup and connect is the TCP handshake. It suggests network latency or packet loss.
- **TLS:** a big gap between connect and appconnect means slow TLS negotiation.
- **Server:** a long wait between appconnect (or pretransfer) and starttransfer means the server is slow producing the first byte. This gap still includes one round trip, so I compare it with the connect time.
- **Download:** the gap between starttransfer and total is the time to transfer the body.
I would repeat the test several times and from another network to rule out noise. The interviewer is listening for: knowing the timing fields are cumulative, mapping each gap to the right layer, and repeating measurements rather than trusting one run.
Troubleshooting with DNS tools
A user says https://app.example.com won't load, but a coworker next to them can reach it fine. Walk me through how you would figure out whether DNS is the problem.
On the affected machine I would run two checks.
1.
2.
Next I would compare both results with
How I read the comparison:
- If getent differs from dig, the cause is local: a /etc/hosts entry or a stale OS cache. I would check /etc/hosts and flush the cache.
- If dig itself differs from what the coworker gets, I would check /etc/resolv.conf or the resolver configuration to see which server the machine is using and whether that server returns stale or wrong data.
- If every method returns the same correct IP, DNS is probably not the problem. I would then test the connection to that IP while keeping the hostname for TLS:
The why: comparing what applications see against what DNS servers return quickly separates a naming problem from a connectivity problem. The interviewer is listening for: a methodical split between DNS and network layers, knowing that dig bypasses /etc/hosts and local caches, querying specific servers, and not guessing.
1.
getent hosts app.example.com (or resolvectl query on systemd-resolved, or Resolve-DnsName on Windows). This shows what the OS resolver, including /etc/hosts and local caches, actually hands to applications.2.
dig app.example.com, which queries the configured DNS server directly.Next I would compare both results with
dig app.example.com @<company resolver>, with a public resolver like 8.8.8.8 (keeping split-horizon DNS in mind, since internal names can legitimately differ), and with the coworker's results.How I read the comparison:
- If getent differs from dig, the cause is local: a /etc/hosts entry or a stale OS cache. I would check /etc/hosts and flush the cache.
- If dig itself differs from what the coworker gets, I would check /etc/resolv.conf or the resolver configuration to see which server the machine is using and whether that server returns stale or wrong data.
- If every method returns the same correct IP, DNS is probably not the problem. I would then test the connection to that IP while keeping the hostname for TLS:
curl -v --resolve app.example.com:443:<IP> https://app.example.com. After that I would look at routing, firewall, or proxy settings.The why: comparing what applications see against what DNS servers return quickly separates a naming problem from a connectivity problem. The interviewer is listening for: a methodical split between DNS and network layers, knowing that dig bypasses /etc/hosts and local caches, querying specific servers, and not guessing.