How to find the ASN of an IP using "dig" command?

How do I find what autonomous system number or name an IP address belongs to?

Could I find it using Ubuntu's dig command?


Solution 1:

Under what autonomous system number or name that an IP is located? How to find it using "dig" command in Ubuntu?

dig is a DNS client and DNS doesn't contain any information about Autonomous System Numbers. However, you can use whois to query for this purpose.

Syntax: whois -h whois.cymru.com " -v [IP_ADDR]"

It helps to use quotes and put a space in front of the -v option.

whois_query Click to zoom in on the image