ipconfig, ping and tracert: check your network
When the internet "is not working", three commands find out where the trouble lies: at your computer, at your router, or beyond it. They only look and measure. They change nothing, apart from two ipconfig options described below.
These commands were not run for this page, because their output would show a real network. The sample outputs are illustrations with made-up addresses.
ipconfig: your computer's addresses
ipconfigWireless LAN adapter Wi-Fi:
Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . : 192.168.1.23
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1The lines that matter:
- IPv4 Address is your computer's address on the local network.
- Default Gateway is the address of your router, the door to the internet.
Addresses beginning 192.168, 10 or 172.16 to 172.31 are private ones, used inside homes and offices. The address the rest of the internet sees belongs to your router and is different.
If the IPv4 address begins with 169.254, the computer asked the router for an address and got no reply. That points to the Wi-Fi or cable connection, or the router itself.
ipconfig /all adds more detail, including the adapter's physical (MAC) address and the DNS servers.
Renewing the address
ipconfig /release
ipconfig /renew
ipconfig /flushdns/releasethen/renewgives up the current address and asks the router for a fresh one. It often cures a connection that says "No internet" after the laptop wakes from sleep. The connection drops for a few seconds while it runs./flushdnsempties the computer's memory of website addresses. It helps when one site will not open although others do, or after a site has moved.
ping: is it reachable?
ping sends a small message to another computer and times the reply.
ping 192.168.1.1Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time=2ms TTL=64
Reply from 192.168.1.1: bytes=32 time=1ms TTL=64
Reply from 192.168.1.1: bytes=32 time=3ms TTL=64
Reply from 192.168.1.1: bytes=32 time=2ms TTL=64
Ping statistics for 192.168.1.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 3ms, Average = 2msEach "Reply from" line is one message that came back, with the time it took in thousandths of a second. The summary gives the number lost.
| You see | It usually means |
|---|---|
| replies with low times | the connection to that device is good |
| replies with high or uneven times | a slow or congested link |
| "Request timed out" | no answer: the device is off, unreachable, or set to ignore pings |
| "Destination host unreachable" | your computer or router has no route to it |
| "could not find host" | the name could not be turned into an address: a DNS problem |
ping -t keeps going until you press Ctrl + C, which is useful for watching a connection that drops now and then. ping -n 10 sends ten messages.
A three-step check
Work outwards from your own computer.
- Ping your router, using the Default Gateway address from
ipconfig. No reply means the trouble is between your computer and the router: Wi-Fi, cable or the router. - Ping a public address by number, such as a well-known public DNS server. Replies here, with none in step 3, mean the internet connection works and name lookup does not.
- Ping a website by name, such as
ping example.com. Replies mean everything works, and the problem is with one site or one program.
Remember that some servers are set not to answer pings, so a single timeout proves little. Try a second address.
tracert: where does it stop?
tracert lists each router on the way to a destination, with the time to reach it.
tracert example.comEach numbered line is one hop. Rows of stars mean a router that did not answer, which is common and not a fault in itself. What matters is where the replies stop for good, or where the times jump sharply. A problem at the first hop is in your own network. A problem several hops out is with your internet provider or beyond, and is something to report to them, not something you can fix.
nslookup: names into addresses
nslookup example.comIt asks your DNS server for the address behind a name. If this fails while pinging a numeric address works, the DNS server is the problem.
Related commands
hostnameprints your computer's name.getmaclists the physical addresses of the network adapters.netstat -anlists the network connections open on your computer.
A word of caution
Network commands found on websites are sometimes aimed at other people's computers or networks. Testing your own connection is fine. Probing systems that you do not own or manage may be against the law and against your provider's terms.
On Linux and the Mac, see ping, curl and network commands.
Examples shown with output were run on 12 November 2026 in a practice folder: Windows commands in cmd.exe on Windows 11, Linux commands with the GNU tools of Git Bash. The folder path and user name were replaced with made-up ones. Commands marked "not run here" are shown as you would type them.
This is an independent learning site. It is not connected with Microsoft, Apple or any Linux distribution. Windows, macOS and other names belong to their owners. Try commands first in a practice folder, never on files you cannot afford to lose.