Tuesday, November 22, 2011

Tips 19: Display below commands output in IP rather hostname ?

These commands were all given the -n flag and will display only IP addresses.

When dealing with networking issues, it often helps to be able to use only IP addresses rather than hostnames. Why? For 2 reasons. First, the name server might not always be available if routing is being changed. And most important, you may not have the time to wait for all the IP resolving to be done.

Fortunately, many networking utilities in Linux share a common option flag. The -n flag. It will allow you to make the utility display IP addresses rather than hostnames. Here are a few examples:

netstat -anp
traceroute 11.12.13.14 -n
arp -n -a -i eth1 -a proxy

No comments:

Post a Comment