tesorouo
V2EX  ›  问与答

请教Linux下Hosts 文件内,一个域名对应多个IP是怎么操作的?

  •  
  •   tesorouo · Aug 24, 2013 · 18902 views
    This topic created in 4673 days ago, the information mentioned may be changed or developed.
    如题。比如我编辑host添加

    192.168.1.1 dev.lan
    192.168.1.2 dev.lan

    我知道windows的结果是,从上到下尝试,如果192.168.1.1挂了以后则访问192.168.1.2。

    但是如果我在Linux下编辑hosts文件,为上述格式,结果一样吗?
    3 replies    1970-01-01 08:00:00 +08:00
    nybux
        1
    nybux  
       Aug 25, 2013
    linux的/etc/hosts不支持此功能
    ericFork
        2
    ericFork  
       Aug 25, 2013   ❤️ 2
    http://blog.xupeng.me/2013/05/15/multiple-ips-with-hosts/

    使用 hosts 解析一个名字到多个 IP
    marchtea
        3
    marchtea  
       Aug 25, 2013   ❤️ 1
    我记得新版的ubuntu增加了新的功能也支持了多DNS了,是增加了一个组件支持的。你可以去看看
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4087 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 58ms · UTC 00:07 · PVG 08:07 · LAX 17:07 · JFK 20:07
    ♥ Do have faith in what you're doing.