Are you seeing the message "Destination Host Unreachable" when you try to ping a computer, server, VM, or network device? Even if you have internet access, you might see this error message when your default gateway cannot find a route to the IP address or hostname you've specified. This wikiHow guide will help you figure out why you're seeing "destination host unreachable" when you ping a host, and walk you through simple troubleshooting steps to help you fix the problem.
Why do I see "destination host unreachable" in ping?
This error occurs when there's no route between your device and the device you're pinging. Though your computer tried to send packets, they never made it past the IP address next to "Reply from." The most common cause is having an incorrect default gateway, subnet mask, or IP address.
Steps
How to Fix "Destination Host Unreachable"
-
1Check all physical connections. If you're getting "destination host unreachable" when you try to ping another system on a local network, double-check your setup–make sure ethernet cables are plugged in where they need to be, and that all networked devices (routers, switches, etc.) are turned on.
- If you're getting "destination host unreachable" when pinging a virtual machine on your computer, make sure the virtual machine is booted up and online.
-
2Temporarily disable all firewalls. While rare, your firewall may be blocking ICMP or ARP requests, which would prevent you from reaching a destination with ping. This could be the firewall on your computer, or it could be the router responsible for sending the request. If disabling all involved firewalls fixes the problem, go through your router settings and disable any features designed to block ARP or ICMP requests.
-
3Restart all network equipment. Don't skip this–a temporary glitch can definitely be responsible for the "destination host unreachable" error, especially on the router end. For example, if the DHCP server isn't working on your router, it may not be assigning you an IP address. Reboot all involved network equipment, including your computer and the remote device, if possible.
-
4Check your IP address, subnet mask, and default gateway. The majority of the time, "destination host unreachable" is due to having the incorrect default gateway or subnet mask set. Make sure the IP address assigned to your computer (the one you are running the ping from ) is correct, that your default gateway is the IP address it should be (typically your router), and that the subnet mask is correct. To view detailed information for all adapters, including the IP address, default gateway, and subnet mask: [3] X Research source
- Windows: Open Command Prompt , type ipconfig /all , and press Enter .
- Mac: Click the Apple menu and go to System Settings > Network , then click the Details button next to your current network. [4] X Research source
- Linux:
Type ip route
and press Enter.
[5]
X
Research source
- Note: If your IP address begins with "169." on any operating system, your computer is not receiving an IP address from the DHCP server. You'll need to check and fix your DHCP settings to fix this.
-
5Rule out DNS problems. If you're trying to ping a hostname (e.g., www.wikihow.com ) instead of an IP address, you may be pinging the wrong IP address due to DNS caching. Try pinging the IP address of the destination instead of using the hostname. If the ping is successful (or you get an error other than "destination host unreachable"), your nameservers are not resolving the hostname to the proper address.
- If the problem is the DNS cache on your computer, you can probably fix it by clearing the DNS cache:
- On Windows, use ipconfig /flushdns .
- On a Mac, use sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder .
- On Linux, use sudo systemd-resolve --flush-caches or systemctl restart dnsmasq.service .
- You can also try changing your DNS servers to those offered by Google (8.8.8.8 and 8.8.4.4). [6] X Research source
- If the problem is the DNS cache on your computer, you can probably fix it by clearing the DNS cache:
-
6Check the routing table. If the issue is related to the network configuration on your computer, you can usually locate the problem in the routing table. To check the routing table on Windows, use the command route print at the Command Prompt. On macOS and Linux, use the command route -n in a terminal window. [7] X Research source Look for any of the following indicators:
- No routes that match the destination.
For example, let's say you are trying to ping 172.28.176.3 and your IP address is 172.28.176.175. You might see a "network destination" or "destination" of 172.28.176.0 with a subnet mask of 255.255.240.0. If your subnet mask is different from the one for your gateway, or the device you're trying to ping is not on the same subnet, you might need to change your subnet mask. [8]
X
Research source
- You may need to make this change on your router, depending on how your IP address is assigned.
- A default route 0.0.0.0 with a valid gateway address. If you're trying to ping a device outside your subnet, you'll need to have a "destination" or "network destination" entry for 0.0.0.0 (or it may just say default ) pointing to your default gateway to properly route the data.
- No routes that match the destination.
For example, let's say you are trying to ping 172.28.176.3 and your IP address is 172.28.176.175. You might see a "network destination" or "destination" of 172.28.176.0 with a subnet mask of 255.255.240.0. If your subnet mask is different from the one for your gateway, or the device you're trying to ping is not on the same subnet, you might need to change your subnet mask. [8]
X
Research source
-
7Set the default gateway manually if needed. If you don't see a default entry, or the entry doesn't have the same gateway, you may need to add the default route manually: [9] X Research source
- Windows:
route add 0.0.0.0 mask 0.0.0.0 <gateway IP address> metric <metric number> if <interface number>
- Linux/Mac: route add default gw <gateway IP address> <interface>
- Windows:
route add 0.0.0.0 mask 0.0.0.0 <gateway IP address> metric <metric number> if <interface number>
-
8Check the ARP table. Checking the ARP table can help you determine whether the MAC address is reachable. In a command prompt or terminal on Windows, Mac, or Linux, run the command arp -a and look for the IP address you tried to ping: [10] X Research source
- If you see a valid MAC address next to the address you tried to ping, ARP is working.
- If you think the device you're trying to ping may have gone to sleep, you can try to send packets to the MAC address to try to wake it.
- On Linux, use etherwake <mac address> . [11] X Research source
- On Windows, you can use the same command, but you'll need Cygwin or WSL .
- On a Mac, open a terminal, and install Homebrew if you haven't yet. Then, run brew install wakeonlan . Finally, run ~/bin/wakeonlan <mac address> . [12] X Research source
- If you think the device you're trying to ping may have gone to sleep, you can try to send packets to the MAC address to try to wake it.
- If you see "ff-ff-ff-ff-ff-ff" next to the IP address instead of a MAC address , the host is not responding.
- If you don't see the IP address at all, try pinging it again, and then run arp -a once more.
- If you see a valid MAC address next to the address you tried to ping, ARP is working.
Expert Q&A
Video
Tips
References
- ↑ https://www.cisco.com/c/en/us/support/docs/ios-nx-os-software/ios-software-releases-121-mainline/12778-ping-traceroute.html
- ↑ https://www.comptia.org/blog/understanding-ping-command-results
- ↑ https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ipconfig
- ↑ https://support-en.wd.com/app/answers/detailweb/a_id/11425
- ↑ https://access.redhat.com/sites/default/files/attachments/rh_ip_command_cheatsheet_1214_jcs_print.pdf
- ↑ https://developers.google.com/speed/public-dns
- ↑ https://docs.oracle.com/cd/E19455-01/806-0916/ipconfig-145/index.html
- ↑ https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc940095(v=technet.10)?redirectedfrom=MSDN
- ↑ https://learn.microsoft.com/en-us/troubleshoot/windows-client/networking/default-gateway-route-not-appear