首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >外部解析dns linux bind9

外部解析dns linux bind9
EN

Stack Overflow用户
提问于 2017-06-03 18:29:23
回答 1查看 274关注 0票数 0

我花了3天的时间试图将我的命名服务器修复到一个.tk域,只是为了测试,因为我不打算去.com。我想了解如何解决我的DNS,即使在外面,而不仅仅是在一个私人网络。重复服务器配置:

named.conf.options

代码语言:javascript
复制
    options {
        directory "/var/cache/bind";

        // If there is a firewall between you and nameservers you want
        // to talk to, you may need to fix the firewall to allow multiple
        // ports to talk.  See http://www.kb.cert.org/vuls/id/800113

        // If your ISP provided one or more IP addresses for stable 
        // nameservers, you probably want to use them as forwarders.  
        // Uncomment the following block, and insert the addresses replacing 
        // the all-0's placeholder.

        // forwarders {
        //      0.0.0.0;
        // };

        //========================================================================
        // If BIND logs error messages about the root key being expired,
        // you will need to update your keys.  See https://www.isc.org/bind-keys
        //========================================================================
        dnssec-validation auto;

        auth-nxdomain no;    # conform to RFC1035
        listen-on-v6 { any; };
};

named.conf.local

代码语言:javascript
复制
    //
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

zone "fresky.tk" IN {
        type master;
        file "/etc/bind/zones/db.fresky.tk";
};

zone "33.163.31.176.in-addr.arpa" IN {
        type master;
        file "/etc/bind/zones/db.33.163.31.176.in-addr.arpa";
};

专区 fresky.tk

代码语言:javascript
复制
;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns1.fresky.tk. admin.fresky.tk. (
                     2006020201 ; Serial
                         604800 ; Refresh
                          86400 ; Retry
                        2419200 ; Expire
                         604800); Negative Cache TTL
;

;
; NS Records
;

fresky.tk.      IN      NS      ns1.fresky.tk.
fresky.tk.      IN      NS      ns2.fresky.tk.

;
; A Records (Only Nameservers)
;

ns1     IN      A       176.31.163.33
ns2     IN      A       176.31.163.33

;
; A Records (General)
;
fresky.tk.      IN      A       176.31.163.33
www.fresky.tk.  IN      A       176.31.163.33
ftp.fresky.tk.  IN      A       176.31.163.33

区域反向

代码语言:javascript
复制
;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     fresky.tk. admin.fresky.tk. ( 
                     2006020201 ; Serial
                         604800 ; Refresh
                          86400 ; Retry
                        2419200 ; Expire
                         604800); Negative Cache TTL
;

;
; NS Records
;
        IN      NS      ns1.fresky.tk.
        IN      NS      ns2.fresky.tk.
;
; PTR Records (Only NameSever)
;
33.163.31.176.in-addr.arpa.     IN      PTR     ns1.fresky.tk.
33.163.31.176.in-addr.arpa.     IN      PTR     ns2.fresky.tk.

;
; PTR Records (General)
;
33.163.31.176.in-addr.arpa.     IN      PTR     ftp.fresky.tk.
33.163.31.176.in-addr.arpa.     IN      PTR     www.fresky.tk.

/etc/host && /etc/presv.con

代码语言:javascript
复制
# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
#     /etc/cloud/cloud.cfg or cloud-config from user-data
176.31.163.33 fresky.tk fresky
127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

search fresky.tk
nameserver 127.0.0.1
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-06-03 20:43:55

您需要在https://my.freenom.com注册胶水记录

(我的域/管理域/管理工具/注册胶记录)

添加176.31.163.33作为ns1.fresky.tkns2.fresky.tk的IP地址

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44347263

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档