Force Ping To Respond With IPv4 Address

You might run into a scenario where you are trying to ping a machine on the domain to find it’s IP address and the ping command returns an IPv6 address!

Ping returns IPv6 by default

Ping is a very useful command for basic network level troubleshooting and has been around for a long time.

Get Ping Help

Type in ping /? into the command prompt to get a list of all the parameters that you can use with ping.

Ping Help

The last two parameters will come in handy for our scenario.

How To Force Ping To Give An IPv4 Address?

Run the command below to return an IPv4 address while using the ping command.

ping <machine name> -4

Adding “-4” at the end will force an IPv4 address response.

Force IPv4 address in ping

How To Force Ping To Give An IPv6 Address?

If you want the reverse for whatever reason, you can add “-6” at the end of the ping command to return an IPv6 address.

ping <machine name> -6

How To Get Continuous Ping?

If you want to have a ping command running until you quit, you can add the “-t” at the end of the command.

ping <machine name> -t
Continuos ping

How To Resolve Address To Host Name?

Run the command below if you have an IP address and you want to check what it resolves to.

ping -a <IP Address> 
Ping resolve address to hostname

Please let me know if you have any questions in the comments section.

Leave a Comment