wubowen
V2EX  ›  问与答

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

  •  
  •   wubowen · May 22, 2022 · 2573 views
    This topic created in 1625 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
    V1Eerie
    May 22, 2022 via Android
    1
    windows 无法复现
    cxtrinityy
    cxtrinityy
    May 22, 2022
    2
    你看你 ping 的结果, placeholder ping statistics, 不知道为啥你 ping test.domain, 会变成 ping placeholder, 要不你把第二行的 placehoder 删掉试试?
    wubowen
    wubowen
    OP
    May 23, 2022
    3
    @cxtrinityy 迷惑的就是第二行加着 placeholder 的时候,去掉以后当然就符合最常用的 hosts 规则了
    julyclyde
    julyclyde
    May 23, 2022
    4
    man hosts 写着呢
    For each host a single line
    should be present with the following information:

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