wubowen
V2EX  ›  问与答

请教怎么解释 hosts 的这种行为

  •  
  •   wubowen · May 22, 2022 · 2155 views
    This topic created in 1465 days ago, the information mentioned may be changed or developed.

    Jietu20220520-151721

    为什么 ping test.domain 的 ip 会是 127.0.0.1 ,这是 hosts 的什么高级用法嘛?系统是 mac os 12.3.1

    5 replies    2022-05-23 19:00:45 +08:00
    V1Eerie
        1
    V1Eerie  
       May 22, 2022 via Android
    windows 无法复现
    cxtrinityy
        2
    cxtrinityy  
       May 22, 2022
    你看你 ping 的结果, placeholder ping statistics, 不知道为啥你 ping test.domain, 会变成 ping placeholder, 要不你把第二行的 placehoder 删掉试试?
    wubowen
        3
    wubowen  
    OP
       May 23, 2022
    @cxtrinityy 迷惑的就是第二行加着 placeholder 的时候,去掉以后当然就符合最常用的 hosts 规则了
    julyclyde
        4
    julyclyde  
       May 23, 2022
    man hosts 写着呢
    For each host a single line
    should be present with the following information:

    IP_address canonical_hostname [aliases...]
    wubowen
        5
    wubowen  
    OP
       May 23, 2022
    @julyclyde 非常感谢,忘了 man 了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1648 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 51ms · UTC 16:26 · PVG 00:26 · LAX 09:26 · JFK 12:26
    ♥ Do have faith in what you're doing.