Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
FREEDOM251

Freedom251 › Blog › DNS

Nslookup Works but Ping Fails: What It Means and How to Troubleshoot It

By Freedom251 Team · · 8 min read

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Nslookup and ping test different parts of a network. Nslookup can successfully obtain DNS records while ping receives no ICMP Echo Reply because the destination, an intermediate firewall, the route, or the selected IPv4/IPv6 path blocks or loses that traffic. A ping timeout therefore does not, by itself, prove that the host is offline.

What each command actually tests

Test What it sends or checks What a successful result proves What it does not prove
nslookup or dig A DNS query to the resolver shown in the output That the resolver returned one or more records for the name at that moment That the returned address is reachable, that the host is online, or that its application is accepting connections
ping ICMP Echo Requests to a chosen address That an ICMP Echo Reply came back from that address That DNS is correct, that ICMP is permitted, or that TCP/HTTPS and the application are working

The two commands can use different paths even when you type the same hostname. DNS may go to a configured resolver, while ping uses the local resolver result, the operating system’s address-selection rules, the routing table, and ICMP policies on every hop. Microsoft’s DNS-client guidance states: “Keep in mind that ICMP traffic must be allowed through the firewall in order for the ping command to work.”

As an Amazon Associate I earn from qualifying purchases.

Why a timeout is an incomplete diagnosis

Request timed out, Destination host unreachable, and a local name-resolution error are different failures. A timeout means no Echo Reply reached your computer before the wait expired. The target may be healthy but configured to drop ICMP, an intermediate firewall may be filtering it, or the return route may be broken. An unreachable message usually identifies a routing or gateway problem closer to your computer. A name-resolution error means ping did not obtain an address to test.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A deterministic troubleshooting workflow

  1. Record every DNS answer and the resolver

    Run nslookup example.com on Windows, or dig example.com on Linux and macOS. Save the resolver address shown in the output and every A (IPv4) and AAAA (IPv6) record. Do not test only the first address if several are returned; different addresses can have different firewall and routing behavior.

    #1 Best Overall
    Sale
    NOYAFA NF-8508 Network Cable Tester with Optical Power Meter | CAT5 CAT6 Cable Toner Ethernet Cable Tester, RJ45 Network Tester, VFL PoE QC Test Wire Tracer Port Flashing 200M Length Test
    • Multifunctional NOYAFA NF-8508 Network Cable Tester: There are nine features to meet your needs. Continuity Testing, Cable Scan, Port Flash, Length Measurement, POE Power Supply Test, QC testing, Optical Power Meter, VFL and NVC function.It is perfectly suited for various engineering cabling projects, network troubleshooting, network equipment maintenance and testing scenarios. Its precise cable scanning and fault localization capabilities help you effortlessly pinpoint the root cause of issues.
    • 7 WAVELENGTHS OPTICAL POWER METER: NF-8508 network cable tester can measure 7 standard wavelengths, 850/1300/1310/1490/1550/1625/1650, power detecting range(dBm): -70 ~ +10. Its power detection range spans from -70 dBm to +10 dBm, supporting FC/SC/ST connectors. It enables precise fiber optic power measurement, helping users efficiently assess fiber signal strength and ensure healthy fiber link operation. It effortlessly detects attenuation issues within fibers, thereby safeguarding fiber network stability.
    • High Efficiency Visual Fault Locator: Easy identification of fiber breakpoints, poor connections, bending or cracking. Excellent for finding the right fiber to splice or quickly finding a break. Emmiting Energy: standard wavelenth: 650nm. Fast flashing, slow flashing, high precison.The built-in self-calibration ensures stable long-term performance, and Class IIIa laser (output<5mW) ensures safe daily operation.
    • PORT FLASHING:The indicator light on the connection port in the NF-8508 device flashes to help accurately locate the cable. Displays port information, including operating speed, duplex mode, and negotiation settings. Port lights flash on the same screen to show the port's operating speed, making it easy to pinpoint lines and ports.
    • PoE Testing and Cable Length Test: PoE testing can check cable mapping polarity and voltage of PoE network switches, withstand 60VDC. Automatically detects and switches between 10M/100M/1000M modes, Includes cable tracking, short circuit test, interruption of circuit test and etc The RJ45 cable tester can quickly measure the length of the cable with a range of 200m. Not only network cables, but also phone lines and BNC cables.
  2. Ping an exact returned IPv4 address

    Copy one A record and run ping 203.0.113.10 using the actual address you recorded. If the numeric address replies but ping example.com fails, the problem is in local name handling or address selection rather than basic reachability to that address. Check the hosts file, DNS suffix/search behavior, cached data, and whether the hostname resolves to a different address when ping runs.

  3. Separate IPv4 from IPv6

    When both record types exist, run ping -4 example.com and ping -6 example.com on Windows. On systems that support those switches, the same explicit-family tests prevent an unreachable IPv6 route from hiding a working IPv4 path, or the reverse. Also ping one recorded IPv6 address directly when you need to distinguish DNS selection from IPv6 routing.

    Rank #2
    Klein Tools VDV501-851 Scout Pro 3 Tester Starter Set Cable Tester | For RJ11/12, RJ45, Coax, withTester, Self-Storing Remote, 5 LanMap and 5 CoaxMap Locator Remotes, Coax F-Adapter, Battery
    • VERSATILE CABLE TESTING: Cable tester tests voice (RJ11/12), data (RJ45), and video (coax F-connector) terminated cables, providing clear results for comprehensive testing on unenergized Ethernet cables (not designed to test PoE)
    • EXTENDED CABLE LENGTH MEASUREMENT: Measure cable length up to 2000 feet (610 m), allowing for precise cable length determination
    • COMPREHENSIVE FAULT DETECTION: Test for Open, Short, Miswire, or Split-Pair faults, ensuring thorough fault detection and identification
    • BACKLIT LCD DISPLAY: Backlit LCD screen displays cable length, wiremap, cable ID, and test results, ensuring easy readability in various lighting conditions
    • EFFICIENT CABLE TRACING: Trace cables, wire pairs, and individual conductor wires using the multiple style tone generator (requires analog probe Cat. No. VDV500-123, sold separately), simplifying cable tracing tasks
  4. Test the local route before blaming the remote host

    Ping your default gateway, then inspect the route table and active interface. A gateway failure points to the local link, adapter, VLAN, Wi-Fi association, or gateway itself. If the gateway replies but the target address does not, examine the default route, VPN routes, access-control lists, and host firewall rules. A VPN can intentionally send only some destinations through a tunnel, leaving another address family or network without a usable route.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  5. Compare DNS servers and clear only demonstrably stale cache

    On Windows, inspect ipconfig /all to see which resolvers and suffixes are configured. Query a permitted known-good resolver directly with nslookup example.com 8.8.8.8 and compare its A and AAAA answers with the normal resolver. Use ipconfig /flushdns only when stale or negative caching is a plausible cause; flushing cannot repair a blocked route or an ICMP policy.

    Rank #3
    Sale
    NOYAFA NF-8506 Network Cable Tester with IP Scan, CAT5 CAT6 Ethernet Tester | PoE PingTest, Network Rate Test, Port Flashing, Network Tester Cable Toner for RJ11 RJ45
    • New Upgraded Multi-function Network Cable Tester: NF-8506 TDR network tester has IP scanning, POE test, anti-interference RJ11 RJ45 CAT5 CAT6 cable test, continuity test, Ping network rate test, port flashing, sensitivity adjustment, cable Function of length test and LED flashlight.
    • 200m cable length test: The NF-8506 Network cable tester is a portable cable length tester. The cable tester can accurately measure the cable length in the range of 8.2ft/ 2.5m-656ft /200m, find the cable fault distance and facilitate real-time field measurementt
    • PING Tester+IP Scanner: This handheld Ping cable toner can be used to diagnose and maintain local area networks (Lans) running TCP/IP protocols. Powerful PING capabilities can verify connections, check the integrity of transmitted and received data, indicate network traffic load by measuring round-trip times and provide IP addresses
    • Network Rate Test + Cable Continuity Test: Ethernet tester can quickly assess network rate issues. Conducts PING tests from multiple locations to gauge server and website response speeds. Allows users to ensure the integrity and connectivity of network cables by identifying any breaks, openings, or short circuits along the cable length.
    • POE Tester: Identifies PoE devices efficiently. Detects crossover methods (unknown/end-span/mid-span/8-core power supply) and polarity. Comprehensive PoE detection, including non-standard, IEEE 802.3AF, and IEEE 802.3AT.
  6. Test the service that you actually need

    If your goal is a website, API, mail server, or other application, perform an authorized TCP or HTTPS check on its documented port. A web server can drop ICMP while accepting HTTPS normally. Treat ping as a path and policy probe, not as a universal application-health test.

How to interpret the common result patterns

Observed results Most likely layer Next action
Hostname resolves; hostname ping times out; direct ping to a returned address also times out ICMP filtering, routing, VPN, ACL, or host stack Ping the gateway, inspect routes, try each returned address and address family, then test the required service port
Hostname resolves; direct IPv4 ping works; hostname ping fails Local name-resolution path, hosts file, suffix/search behavior, or address selection Compare the address used by ping with the addresses from nslookup; check local overrides and force -4 or -6
IPv4 ping works; IPv6 ping fails IPv6 route, firewall, tunnel, or destination policy Inspect IPv6 configuration and routes; use IPv4 for the application only if that is an intentional, temporary workaround
Gateway fails to answer Local interface, link, VLAN, Wi-Fi, gateway, or local firewall Verify the interface address, mask, gateway, connection state, and local firewall before testing the Internet target again
Ping fails but an authorized TCP/HTTPS test succeeds ICMP policy only Stop treating ping as a service outage indicator; monitor the application protocol instead
Normal resolver returns different records from a direct resolver query Resolver policy, split DNS, interception, cache, or search-domain behavior Identify which resolver the client is required to use and whether the differing address is reachable from this network

Why DNS can work while ICMP does not

ICMP is blocked by the destination or an intermediate firewall

Many hosts and networks deliberately discard Echo Requests. Security gateways may allow DNS and HTTPS while denying ICMP, or permit ICMP only from management networks. In that case, a successful lookup and a ping timeout are expected together. Do not disable a firewall or change policy on a network you do not administer; ask the network owner whether ICMP is permitted and use an approved service-level test.

Rank #4
Sale
Klein Tools VDV500-920 Wire Tracer Tone Generator and Probe Kit Continuity Tester for Ethernet, Internet, Telephone, Speaker, Coax, Video, and Data Cables, RJ45, RJ11, RJ12
  • DIGITAL MODE: Easily trace and locate cables on an active network to identify their paths and destinations effectively
  • ANALOG MODE: Isolate individual wire pairs, facilitating the tracing of voice, data, video, and audio cables
  • CONTINUITY AND POLARITY TESTING: Results for continuity and polarity tests are displayed on LEDs that are clearly labeled and easy to read
  • TRACE UNSTRIPPED WIRES: Rugged Angled Bed of Nails (ABN) clips securely attach to wires
  • WIRE MAPPING CAPABILITIES: Utilize wire mapping capabilities to verify Pin-to-Pin connections and shield detection

The route, gateway, VPN, or ACL is wrong

DNS may be answered by a nearby resolver even when the route to the returned address is absent. A changed default gateway, overlapping VPN subnet, stale tunnel, or ACL can affect one destination while leaving DNS untouched. Compare the route for the exact returned address, not merely the presence of a default route. Check whether behavior changes when the VPN is disconnected only if your organization permits that test.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Ping and nslookup are taking different name-resolution paths

Operating systems can combine DNS servers, a local hosts file, suffix/search lists, cached answers, and resolver-specific policies. A manually typed nslookup query asks the resolver directly, while applications may use the system resolver service and its cache. If numeric-address ping works, compare the address selected for the hostname with every address recorded from nslookup. Remove or correct an obsolete hosts-file entry and verify the intended suffix before changing DNS settings.

Best Value
Klein Tools VDV526-200 LAN Scout Jr Cable Tester Ethernet Cable Tester Kit | Tests CAT5e, CAT6/6A Cables with RJ45 Connectors, Includes Tester, Remote, Batteries
  • VERSATILE CABLE TESTING: Cable tester for data (RJ45) terminated cables and patch cords, ensuring comprehensive testing capabilities
  • LARGE BACKLIT LCD: Backlit LCD display enables easy reading of pin-to-pin wiremap results, even in low-lit areas
  • COMPREHENSIVE FAULT DETECTION: Test for Open, Short, Miswire, Split-Pair faults, Cross-over, and Shield, providing thorough fault detection
  • INTUITIVE USER INTERFACE: User-friendly interface with three buttons and simple, easy-to-identify test responses, ensuring a smooth testing experience
  • MULTIPLE TONE GENERATOR STYLES: Tone on a single wire, wire pair, or all 8 conductor wires using the multiple style tone generator (solid/warble); requires probe Cat. No. VDV500-123 (sold separately)

The A/AAAA choice does not match the available route

A name with both record types can appear unreliable when the client prefers IPv6 but has no usable IPv6 path. The destination may also permit ICMP on IPv4 but not IPv6. Explicit ping -4 and ping -6 tests reveal which family fails. Fix the underlying route or policy rather than permanently hiding valid records, unless your network administrator has chosen an intentional address-family preference.

Stale negative cache or a suffix mismatch creates a misleading comparison

A cached “name does not exist” response, an old address, or an unexpected search suffix can make a short hostname resolve differently from its fully qualified name. Compare the fully qualified name, the resolver shown by the client, and the answer returned after the relevant cache lifetime. On Windows, ipconfig /flushdns removes the local DNS cache, but it does not clear upstream caches and does not alter hosts-file entries.

DNS transport is filtered or intercepted

A resolver query can succeed because a local gateway, captive portal, security appliance, or managed DNS service answers it, even when ordinary traffic to the returned address is restricted. Conversely, a direct query to another resolver may be blocked while the configured resolver works. Compare answers and resolver addresses only within the network policy that applies to you; unexpected differences should be reported to the network administrator rather than bypassed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Windows checks that narrow the fault quickly

  • Configuration: Run ipconfig /all. Record the interface address, subnet mask, default gateway, DNS servers, connection-specific suffix, and whether an IPv6 address and gateway are present.
  • Cache: Run ipconfig /displaydns to look for an old or negative entry, then use ipconfig /flushdns only when that evidence supports it.
  • Routes: Run route print and look for the route covering the exact returned address. A more-specific VPN route can override the normal gateway.
  • Path: Use tracert 203.0.113.10 for the actual returned address. Asterisks identify hops that did not answer that diagnostic; they do not automatically identify the failure point because routers may forward traffic while suppressing traceroute replies.
  • Application port: In PowerShell, an authorized check such as Test-NetConnection example.com -Port 443 tests TCP connectivity to port 443. A successful TCP result with failed ping indicates that ICMP is not a suitable health signal for that service.

Linux and macOS checks

  • Use dig example.com to view the resolver and A/AAAA answers, then run ping -4 example.com and ping -6 example.com where supported.
  • Inspect routes with ip route on Linux. On macOS, route -n get 203.0.113.10 shows the route selected for a specific address.
  • Check the local resolver configuration and any hosts-file entry, then repeat the lookup after correcting an identified stale entry. Avoid editing resolver files on managed systems without following the platform’s network-management policy.
  • For an authorized TCP check, use the platform’s available networking utility against the service port, for example nc -vz example.com 443 when netcat is installed. A refused connection is different from a timeout: refusal means the destination or a gateway actively rejected the TCP attempt, while timeout means no completion arrived.

Fixes matched to the evidence

  • ICMP policy: Have the destination or network administrator allow Echo Requests only where appropriate, or document that ping is intentionally unavailable. Do not weaken a firewall merely to make ping reply.
  • Bad local route: Restore the correct gateway, remove an unintended VPN route, repair the interface, or correct the ACL. Re-test the gateway and exact destination address after each change.
  • Wrong address selected: Correct the hosts file, suffix/search configuration, or resolver policy. Verify both A and AAAA records and test the family that the application is expected to use.
  • Stale cache: Flush the client cache after confirming stale data, then repeat the lookup and record the new TTL and addresses. If the answer remains wrong, investigate the authoritative or managed resolver rather than repeatedly flushing.
  • Service-only outage: Monitor the application protocol and port. Escalate with the hostname, exact address, address family, timestamp, resolver used, route, and service-test result so the network or service owner can reproduce the correct layer.

A compact decision checklist

  1. Did DNS return the expected A and AAAA records, and which resolver supplied them?
  2. Does ping to the exact returned address behave differently from ping to the hostname?
  3. Do explicit IPv4 and IPv6 tests produce different results?
  4. Can the default gateway and the route to the destination be verified?
  5. Is ICMP allowed by the destination and every managed network in between?
  6. Does the required TCP or HTTPS service respond even though ping does not?

Keep the outputs from each test together. The combination of resolver, selected address, address family, route, and application-port result identifies the failing layer far more reliably than a single ping timeout.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

DNSICMPIPv4IPv6Network Troubleshootingnslookupping

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.