How to Ping a Server: A Complete Guide

Learn how to ping an IP address on Windows, macOS, and Linux. Understand TTL, packet loss, traceroute, and when to use ping for email server troubleshooting.

ip

How to Ping a Server: A Complete Guide

The ping command is one of the most fundamental network diagnostic tools available. It sends ICMP Echo Request packets to a target host and measures the round-trip time for each response. Despite its simplicity, ping is often the first tool administrators reach for when diagnosing connectivity issues, including problems with email delivery.

How Ping Works

Ping uses the Internet Control Message Protocol (ICMP), defined in RFC 792. When you ping a host, your system sends an ICMP Type 8 (Echo Request) packet. If the target is reachable and configured to respond, it returns an ICMP Type 0 (Echo Reply) packet. The time between sending the request and receiving the reply is the round-trip time (RTT).

Ping on Windows

Open Command Prompt or PowerShell and run:

ping 8.8.8.8

By default, Windows sends four packets and then stops. To ping continuously (like Unix systems), use the -t flag:

ping -t mail.example.com

Press Ctrl+C to stop and view the summary statistics.

Other useful flags:

  • -n 10 -- send exactly 10 packets
  • -l 1472 -- set packet size (useful for MTU testing)
  • -4 or -6 -- force IPv4 or IPv6

Ping on macOS and Linux

Open Terminal and run:

ping 8.8.8.8

On Unix systems, ping runs continuously by default. Press Ctrl+C to stop. To limit the count:

ping -c 10 mail.example.com

Useful flags:

  • -c 10 -- send 10 packets
  • -i 0.5 -- set interval to 0.5 seconds between packets
  • -s 1472 -- set packet size
  • -W 3 -- set timeout to 3 seconds

Reading Ping Results

A typical ping output looks like this:

64 bytes from 8.8.8.8: icmp_seq=1 ttl=118 time=12.4 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=118 time=11.8 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=118 time=13.1 ms

--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 11.8/12.4/13.1/0.5 ms

Key metrics:

  • TTL (Time to Live): The number of hops remaining before the packet is discarded. Each router decrements this value by one. A TTL of 118 suggests the initial TTL was 128 (Windows default) and the packet traversed approximately 10 hops. Linux systems typically start with a TTL of 64.
  • time: Round-trip time in milliseconds. For email servers, anything under 100ms is generally acceptable. Consistently high latency may indicate routing issues or geographic distance.
  • Packet loss: The percentage of packets that received no reply. Any packet loss above 0% warrants investigation. Sustained loss of 5% or more will degrade real-time applications and may indicate network congestion, hardware failure, or rate limiting.

Traceroute: Following the Path

When ping shows high latency or packet loss, traceroute (or tracert on Windows) reveals where the problem occurs by showing each hop along the route:

# Linux/macOS
traceroute mail.example.com

# Windows
tracert mail.example.com

Each line in the output represents a router along the path. If latency spikes or packets start dropping at a specific hop, that narrows the problem to a particular network segment.

When to Use Ping for Email Troubleshooting

Ping is a valuable first step when diagnosing email delivery issues:

  • Verify mail server reachability. If you cannot ping your MX host, there may be a DNS resolution failure, a network outage, or a firewall blocking traffic. Look up your domain's MX records with our DNS Lookup tool to confirm the correct hostnames.
  • Check latency to mail servers. High latency between your sending infrastructure and the destination mail server can cause SMTP timeouts, especially if the connection must traverse multiple geographic regions.
  • Confirm DNS resolution. Pinging a hostname confirms that DNS resolution is working. If ping mail.example.com fails with "could not find host," the issue is DNS, not connectivity.
  • Baseline network performance. Regular ping checks against your outbound mail servers establish a performance baseline, making it easier to spot degradation.

Note that some mail servers block ICMP traffic as a security measure. A failed ping does not necessarily mean the server is down -- it may simply be configured to drop ICMP packets. In that case, use telnet on port 25 or a tool like our IP Reputation checker to verify the server is responding to SMTP connections.

Ping vs. Other Diagnostic Tools

Tool Protocol Best For
ping ICMP Basic reachability and latency
traceroute ICMP/UDP Identifying where along a path problems occur
telnet TCP Verifying specific port connectivity
nslookup/dig DNS Resolving hostnames and checking DNS records
mtr ICMP Continuous traceroute with statistics

For email-specific diagnostics, combine ping with DNS lookups and authentication checks. Start with a ping check to confirm basic connectivity, then use InboxTooling's Full Report to validate MX records, SPF, DKIM, and DMARC configuration in a single pass.


Stay on top of your email infrastructure. Sign up for the InboxTooling newsletter for deliverability tips, tool updates, and best practices.