最简单的方法是使用 ping
命令。在命令行中输入 ping 域名
,系统就会返回该域名对应的 IP 地址。例如,输入 ping www.example.com
,系统会显示 PING www.example.com (93.184.216.34): 56 data bytes
,其中 93.184.216.34
就是 www.example.com
的 IP 地址。
另一个常用的方法是使用 nslookup
命令。在命令行中输入 nslookup 域名
,系统会返回更详细的信息,包括域名的 IP 地址、DNS 服务器等。例如,输入 nslookup www.example.com
,系统会显示 Server: 192.168.1.1
和 Address: 93.184.216.34
,其中 93.184.216.34
就是 www.example.com
的 IP 地址。
你需要更详细的信息,可以使用 dig
命令。在命令行中输入 dig 域名
,系统会返回域名的 IP 地址、DNS 服务器、TTL 值等信息。例如,输入 dig www.example.com
,系统会显示 93.184.216.34
作为该域名的 IP 地址。