【问题标题】:Redirect domain names from linux dns server从 linux dns 服务器重定向域名
【发布时间】:2012-02-27 23:20:21
【问题描述】:

因此,IT 部门决定更改一堆域名,这破坏了我实验室网络中的一堆东西。我有一个 suse linux dns 服务器(我没有设置,也不太了解)。我想知道是否有办法让它手动将 IP 地址解析为旧域名。 简单地修改我实验室中的软件以指向新域名是行不通的(因为其他站点的其他实验室仍将使用旧域名)。

【问题讨论】:

  • 你知道 suse 机器使用什么程序来进行 DNS 查找吗?
  • 将旧分辨率添加到 /etc/hosts 文件怎么样?
  • 但他会更改所有受影响机器的主机文件
  • 我是这么想的,但是有几百台机器,而且每天可能都会重新安装操作系统。

标签: linux dns


【解决方案1】:

这里有一些来自this tutorial的相关引用:

Examples Corporation 已分配网络 192.0.2.0/24,我们在内部使用 10.0.0.0/24。

让我们开始为外部名称和 IP 提供服务,我们编辑 /etc/bind/named.conf.local4 并添加:

zone "example.com" {
    type master;
    file "/etc/bind/db.example.com";
};

然后我们使用以下内容创建 /etc/bind/db.example.com:

; example.com
$TTL    604800
@       IN      SOA     ns1.example.com. root.example.com. (
                     2006020201 ; Serial
                         604800 ; Refresh
                          86400 ; Retry
                        2419200 ; Expire
                         604800); Negative Cache TTL
;
@       IN      NS      ns1
        IN      MX      10 mail
        IN      A       192.0.2.1
ns1     IN      A       192.0.2.1
mail    IN      A       192.0.2.128 ; We have our mail server somewhere else.
www     IN      A       192.0.2.1
client1 IN      A       192.0.2.201 ; We connect to client1 very often.

因此,您要做的是将“example.com”替换为您的程序访问的任何域,将“192.0.2.whatever”替换为您的目标IP,并删除“ns1”、“mail”、“www”、 "clien1" 行并将其替换为

*.yourdomain.com. IN      A       your.ip.address.255

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-12-30
    • 2013-11-24
    • 2013-10-02
    • 1970-01-01
    • 1970-01-01
    • 2015-07-04
    • 2020-04-03
    • 2020-07-03
    相关资源
    最近更新 更多