Linux command to translate domain name to IP

LinuxIpDomain Name

Linux Problem Overview


Is there any Linux command to translate a domain name to an IP address?

Linux Solutions


Solution 1 - Linux

Use this

$ dig +short stackoverflow.com

69.59.196.211

or this

$ host stackoverflow.com

stackoverflow.com has address 69.59.196.211
stackoverflow.com mail is handled by 30 alt2.aspmx.l.google.com.
stackoverflow.com mail is handled by 40 aspmx2.googlemail.com.
stackoverflow.com mail is handled by 50 aspmx3.googlemail.com.
stackoverflow.com mail is handled by 10 aspmx.l.google.com.
stackoverflow.com mail is handled by 20 alt1.aspmx.l.google.com.

Solution 2 - Linux

You can use:

nslookup www.example.com

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionFrankView Question on Stackoverflow
Solution 1 - LinuxunutbuView Answer on Stackoverflow
Solution 2 - LinuxDirk VollmarView Answer on Stackoverflow