美文网首页
DNS服务器(bind)安装

DNS服务器(bind)安装

作者: shangyaqi | 来源:发表于2018-06-05 15:13 被阅读71次

    1:安装
    安装bind: yum install bind
    启动服务: service named start
    设置开机启动:systemctl enable named

    2:配置
    编辑配置文件 /etc/named.conf
    中添加域
    zone "dockerpaas.com" {
    type master;
    file "/var/named/dockerpaas.com";
    };
    修改相关配置项:
    listen-on port 53 { any; };
    listen-on-v6 port 53 { ::1; };
    directory "/var/named";
    dump-file "/var/named/data/cache_dump.db";
    statistics-file "/var/named/data/named_stats.txt";
    memstatistics-file "/var/named/data/named_mem_stats.txt";
    allow-query { any; };
    recursion yes;
    dnssec-enable no;
    dnssec-validation no;

    3:新建 /var/named/dockerpaas.com 配置文件

    $TTL 3H
    @ IN SOA @ demo.com. (
    0 ; serial
    1D ; refresh
    1H ; retry
    1W ; expire
    3H ) ; minimum
    NS @
    A 127.0.0.1
    AAAA ::1

    *.traefik IN A 192.168.1.99

    ( 192.168.1.99:是traefik地址)

    4:重启测试
    systemctl restart named
    配置域名服务器:vim /etc/resolv.conf
    添加 nameserver 192.168.1.86

    nslookup a.traefik.dockerpaas.com

    返回结果

    相关文章

      网友评论

          本文标题:DNS服务器(bind)安装

          本文链接:https://www.haomeiwen.com/subject/usopsftx.html