3 ways to get a domain's IP address - Linux Tips

Bo on January 13, 2020

We can use ping, nslookup and dig to get a domain's IP: $ ping google.com PING google.com((2607:f8b0:4006:819::200e)) 56 data bytes $ nsloo... [Read Full]
markdown guide

Thing to bear in mind is, if a given DNS target has multiple A records, your response from (especially) ping can be quite variable (e.g., if your target has three IPs and there's no record-caching effects in play, each time you ping you could end up with any one of those three IPs being selected). Both dig and nslookup will at least return all the A records ...but are less-frequently installed on hosts.

Things get really if your target's DNS is being managed by a some kind of policy-service. Depending on the actions of that policy-service, you can get really variable responses.


I studied dig command and, it is very options for searching IP's.

code of conduct - report abuse