将域名转换为 IP 的 Linux 命令

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3963085/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-03 23:44:41  来源:igfitidea点击:

Linux command to translate DomainName to IP

linuxipdomain-name

提问by Frank

Is there any Linux command to translate domain name to IP?

是否有任何 Linux 命令将域名转换为 IP?

回答by Dirk Vollmar

You can use:

您可以使用:

nslookup www.example.com

回答by unutbu

% dig +short stackoverflow.com
69.59.196.211

or

或者

% 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.