• 怎么知道一个域名对应的 IP 是什么?


    以 Mac 为例子

    1. 打开 iTerm2 (  Mac 终端 or  Windows  终端)
    2. 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 地址和统计的延时信息

  • 相关阅读:
    ural1238. Folding(记忆化)
    URAL1410. Crack
    树套树Day1线段树套平衡树bzoj3196
    noipd2t3列队
    NOIP2017D1T3
    uoj279温暖会指引我们前行
    一篇打脸文
    Link-Cut Tree
    重口味费用流
    bzoj1000~1025
  • 原文地址:https://www.cnblogs.com/jenasy/p/12523943.html
Copyright © 2020-2023  润新知