以 Mac 为例子
- 打开 iTerm2 ( Mac 终端 or Windows 终端)
- dig 域名
dig ucloud.cn ; <<>> DiG 9.10.6 <<>> ucloud.cn ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13175 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;ucloud.cn. IN A ;; ANSWER SECTION: ucloud.cn. 30 IN A 123.59.130.66
可以看到当前域名 ucloud.cn 直接 A 记录到的 IP 是 123.59.130.66
或者直接用 ping 的方式(但有的情况会被禁 ping)
ping ucloud.cn PING ucloud.cn (123.59.130.66): 56 data bytes 64 bytes from 123.59.130.66: icmp_seq=0 ttl=43 time=223.814 ms 64 bytes from 123.59.130.66: icmp_seq=1 ttl=43 time=26.982 ms 64 bytes from 123.59.130.66: icmp_seq=2 ttl=43 time=26.473 ms 64 bytes from 123.59.130.66: icmp_seq=3 ttl=43 time=27.259 ms 64 bytes from 123.59.130.66: icmp_seq=4 ttl=43 time=26.994 ms ^C --- ucloud.cn ping statistics --- 5 packets transmitted, 5 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 26.473/66.304/223.814/78.755 ms
也可以看到有返回对应的 IP 地址和统计的延时信息