Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
nsznsznsz
V2EX  ›  Linux

怎么给 dnsmasq 设置从一个域名映射到另一个域名?

  •  
  •   nsznsznsz · Aug 1, 2017 · 5313 views
    This topic created in 3389 days ago, the information mentioned may be changed or developed.
    比如我想把我自己定义的一个域名比如 test.abc.com 映射成 tieba.baidu.com

    也就是当我想解析 test.abc.com 的时候实际去解析 tieba.baidu.com ,然后返回 tieba.baidu.com 对应的 IP

    应该怎么配置?这用 dnsmasq 能做到吗?
    6 replies  •  2017-08-02 13:51:05 +08:00
    sneezry
    sneezry
    Aug 1, 2017 via iPhone
    1
    cname 么
    isCyan
    isCyan
    Aug 1, 2017 via Android
    2
    这不就是 cname 吗,test.abc.com 设置 cname 记录指向 tieba.baidu.com
    wuwuyun
    wuwuyun
    Aug 1, 2017
    3
    dnsmasq 里是可以配置的
    加一条 cname=xxx.xxx,target

    但是 target 域名必须要在 /etc/hosts 里面或者其他地方有指向

    There are significant limitations on the target; it must be a DNS name which is known to dnsmasq from /etc/hosts (or additional hosts files), from DHCP, from --interface-name or from another --cname.
    nsznsznsz
    nsznsznsz
    OP
    Aug 1, 2017
    4
    那这样不就是写死了吗?。。target 不能动态获取 IP 了
    nsznsznsz
    nsznsznsz
    OP
    Aug 1, 2017
    5
    @wuwuyun 这样不就是写死了吗?。。target 不能动态获取 IP 了
    wuwuyun
    wuwuyun
    Aug 2, 2017
    6
    @nsznsznsz 还想怎么动态,写了 /etc/hosts 又不是不能改
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3246 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 00:55 · PVG 08:55 · LAX 16:55 · JFK 19:55
    ♥ Do have faith in what you're doing.