最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Docker使用Bind9實現(xiàn)域名解析的思路詳解

 更新時間:2022年11月17日 08:21:39   作者:樂碼客  
這篇文章主要介紹了DOCKER使用BIND9實現(xiàn)域名解析,主要包括刷新服務(wù)修改配置文件信息,實現(xiàn)思路也很簡單,本文給大家介紹的非常詳細對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下

刷新服務(wù)

cd /free_cicdfs0/compose/bind9
docker-compose down; docker-compose up  -d

修改配置文件

新版本 配置文件 大致結(jié)構(gòu)發(fā)生了一些改變

cat /free_cicdfs0/data/bind9/etc/bind/named.conf
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";

從 114 緩存 查詢 數(shù)據(jù)

cat > /free_cicdfs0/data/bind9/etc/bind/named.conf.options <<"EOF"

# include "/etc/rndc.key";

controls {
    inet 127.0.0.1 port 953
    allow { 127.0.0.1; } keys { "rndckey"; };
};

options {
    
    // set no
    dnssec-enable no;
    dnssec-validation no;

    listen-on port 53 { any; };

    allow-query { any; };

    forwarders {
        114.114.114.114;
    };
};

EOF

chmod 777 -R  /free_cicdfs0/data/bind9/
chown root:root -R  /free_cicdfs0/data/bind9/

chown root:named -R  /free_cicdfs0/data/bind9/

docker-compose up -d 
# log error
couldn't add command channel 127.0.0.1#953: file not found
docker cp -a bind9:/etc/bind  /free_cicdfs0/data/bind9/etc/

docker cp -a bind9:/var/lib/bind  /free_cicdfs0/data/bind9/var/lib/

可以 dig 無法 ping

broken trust chain resolving 'baidu.com/AAAA/IN': 114.114.114.114#53

解決:
由于是局域網(wǎng)內(nèi)非法DNS,所以將DNS安全關(guān)閉.
[root@192-168-174-42 ~]# vim /etc/named.conf
將下面的兩項設(shè)置為no
        dnssec-enable no;
        dnssec-validation no;

查看 已經(jīng) 區(qū)域 解析,并添加 新的 解析 項

cat /free_cicdfs0/data/bind9/etc/bind/named.conf.default-zones
// prime the server with knowledge of the root servers
zone "." {
        type hint;
        file "/usr/share/dns/root.hints";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
        type master;
        file "/etc/bind/db.local";
};

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

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

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

https://nginx164190.zk.wh.com/

192.168.164.190 nginx164190.zk.wh.com

在 linux 安裝 局域網(wǎng) cert

# 添加 解析 條目
vi /etc/hosts
192.168.164.190  nginx164190.zk.wh.com
 
[root@node01 ~]# curl https://nginx164190.zk.wh.com/
curl: (60) Peer's Certificate issuer is not recognized.
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.


curl -o install_cert_linux.zip http://192.168.164.190:40080/install_cert_linux.zip
unzip install_cert_linux.zip

cd install_cert_linux
./install_cert.sh

# 測試 效果
curl https://nginx164190.zk.wh.com/
<html>
<head><title>Index of /</title></head>
<body>
<h1>Index of /</h1><hr><pre><a href="../">../</a>
<a href="_wildcard.zk.wh.com.crt">_wildcard.zk.wh.com.crt</a>                            18-Aug-2021 08:53    1464
<a href="_wildcard.zk.wh.com.pem">_wildcard.zk.wh.com.pem</a>                            18-Aug-2021 08:53    1464
<a href="install_cert_linux.zip">install_cert_linux.zip</a>                             19-Aug-2021 07:30      2M
<a href="rootCA-key.pem">rootCA-key.pem</a>                                     18-Aug-2021 08:53    2488
<a href="rootCA.pem">rootCA.pem</a>                                         18-Aug-2021 08:53    1635
<a href="test">test</a>                                               18-Aug-2021 08:47       7
</pre><hr></body>
</html>

rndc

1、953端口是rndc 的端口

2、rndc是監(jiān)控bind的統(tǒng)計數(shù)據(jù)用的,同時不需要為了更新某個zone而重啟bind

查看 默認的 解析條目

cat /etc/bind/named.conf.default-zones
// prime the server with knowledge of the root servers
zone "." {
        type hint;
        file "/usr/share/dns/root.hints";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
        type master;
        file "/etc/bind/db.local";
};

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

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

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

添加 自己的 解析條目

多臺 dns 之間 進行 協(xié)同
SOA
NS

# A 代表 解析到 ipv4
@       IN      A       127.0.0.1

# A 代表 解析到 ipv6
@       IN      AAAA    ::1

# ptr 代表 逆向解析
1.0.0   IN      PTR     localhost.
cat /etc/bind/named.conf
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";

// add you zones
include "/etc/bind/named.conf.my-zones";


# 模仿 /etc/bind/named.conf.default-zones 書寫 新的 解析記錄
cat > /etc/bind/named.conf.my-zones <<"EOF"

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

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

EOF

# 模仿db 文件
cat /etc/bind/db.local
;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      localhost.
@       IN      A       127.0.0.1
@       IN      AAAA    ::1


cat > /etc/bind/db.zk.wh.com <<"EOF"
$TTL 86400
@ IN SOA localhost. root.localhost. (
        1  ; Serial
    604800  ; Refresh
    86400  ; Retry
   2419200  ; Expire
    86400 ) ; Negative Cache TTL
;
@ IN NS localhost.
nginx164190       IN      A       192.168.164.190
zcloud164190       IN      A       192.168.164.190


EOF


# 模仿 逆解 文件
cat /etc/bind/db.127
;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      localhost.
1.0.0   IN      PTR     localhost.


cat > /etc/bind/db.192 <<"EOF"
$TTL 86400
@ IN SOA localhost. root.localhost. (
        1  ; Serial
    604800  ; Refresh
    86400  ; Retry
   2419200  ; Expire
    86400 ) ; Negative Cache TTL
;
@ IN NS localhost.
190.164.168   IN      PTR     nginx164190.

EOF

更新 解析記錄

# 局域網(wǎng) x509 證書 無法 信任 多重域名
# Reminder: X.509 wildcards only go one level deep, so this won't match a.b.zk.wh.com ??
cat > /free_cicdfs0/data/bind9/etc/bind/db.zk.wh.com <<"EOF"
$TTL 86400
@ IN SOA localhost. root.localhost. (
        1  ; Serial
    604800  ; Refresh
    86400  ; Retry
   2419200  ; Expire
    86400 ) ; Negative Cache TTL
;
@ IN NS localhost.
nginx164190       IN      A       192.168.164.190
zcloud164190      IN      A       192.168.164.190
hub-docker        IN      A       192.168.99.100
EOF
# 重啟 容器 服務(wù) 即可生效
ssh root@192.168.99.2
cd /free_cicdfs0/composes/bind9
docker-compose restart
# test
ping hub-docker.zk.wh.com
PING hub-docker.zk.wh.com (192.168.99.100) 56(84) bytes of data.
64 bytes from 192.168.99.100: icmp_seq=1 ttl=64 time=0.172 ms
64 bytes from 192.168.99.100: icmp_seq=2 ttl=64 time=0.152 ms

到此這篇關(guān)于DOCKER使用BIND9實現(xiàn)域名解析的文章就介紹到這了,更多相關(guān)DOCKER使用BIND9實現(xiàn)域名解析內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • 使用 Docker 搭建 Laravel 本地環(huán)境的教程詳解

    使用 Docker 搭建 Laravel 本地環(huán)境的教程詳解

    laradock 是一個包含全功能用于 docker 的 PHP 運行環(huán)境,使用 docker-compose 方式部署,本文重點給大家介紹使用 Docker 搭建 Laravel 本地環(huán)境的方法,感興趣的朋友一起看看吧
    2017-10-10
  • Docker 安裝 MySQL 并實現(xiàn)遠程連接教程

    Docker 安裝 MySQL 并實現(xiàn)遠程連接教程

    這篇文章主要介紹了Docker 安裝 MySQL 并實現(xiàn)遠程連接的教程,幫助大家更好的理解和使用docker容器,感興趣的朋友可以了解下
    2020-09-09
  • Docker連接宿主Redis的方法步驟

    Docker連接宿主Redis的方法步驟

    本文主要介紹了Docker連接宿主Redis的方法步驟,可以輕松地使用Docker容器與宿主機上的Redis進行交互,實現(xiàn)高效的數(shù)據(jù)存儲和共享,,具有一定的參考價值,感興趣的可以了解一下
    2024-01-01
  • Docker 教程之存出和載入鏡像,移除及鏡像實現(xiàn)原理

    Docker 教程之存出和載入鏡像,移除及鏡像實現(xiàn)原理

    這篇文章主要介紹了Docker 教程之存出和載入鏡像,移除及鏡像實現(xiàn)原理的相關(guān)資料,需要的朋友可以參考下
    2016-12-12
  • docker容器增加或者修改容器映射端口的實現(xiàn)方法

    docker容器增加或者修改容器映射端口的實現(xiàn)方法

    在只有使用docker安裝的容器,沒有使用docker-compose或者其他客戶端工具,如果要增加或者修改容器端口,也是可以增加或者修改容器端口映射,本文給大家介紹了docker容器增加或者修改容器映射端口的實現(xiàn)方法,需要的朋友可以參考下
    2025-01-01
  • 詳解Docker-compose networks 的例子

    詳解Docker-compose networks 的例子

    這篇文章主要介紹了詳解Docker-compose networks 的例子,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-09-09
  • Docker啟動常用容器命令及配置詳解

    Docker啟動常用容器命令及配置詳解

    本文主要介紹了Docker啟動常用容器命令及配置詳解,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2023-03-03
  • Docker實現(xiàn)鏡像批量導(dǎo)出與導(dǎo)入的完整指南

    Docker實現(xiàn)鏡像批量導(dǎo)出與導(dǎo)入的完整指南

    這篇文章主要為大家詳細介紹了如何通過Docker實現(xiàn)鏡像批量導(dǎo)出與導(dǎo)入,文中的示例代碼講解詳細,感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下
    2025-12-12
  • 使用Docker進行node開發(fā)時實現(xiàn)熱加載功能

    使用Docker進行node開發(fā)時實現(xiàn)熱加載功能

    這篇文章主要介紹了使用docker進行vue、react或者node開發(fā)時實現(xiàn)熱加載功能,即宿主機文件修改之后實時刷新或者實時重啟服務(wù),文中通過代碼示例介紹的非常詳細,具有一定的參考價值,需要的朋友可以參考下
    2024-09-09
  • 使用Docker部署Filestash文件管理器的實現(xiàn)步驟

    使用Docker部署Filestash文件管理器的實現(xiàn)步驟

    Filestash是一款功能強大的網(wǎng)絡(luò)文件管理工具,它允許用戶在單一界面下管理分布于不同地點和平臺的數(shù)據(jù),本文就來介紹一下Docker部署Filestash文件管理器的實現(xiàn)步驟,感興趣的可以了解一下
    2025-07-07

最新評論

思茅市| 广平县| 安乡县| 翼城县| 广德县| 邢台市| 山东| 临汾市| 丰城市| 怀远县| 木兰县| 阿图什市| 合水县| 清水县| 平舆县| 隆化县| 新邵县| 河间市| 岳阳县| 太原市| 公安县| 临泽县| 武城县| 岐山县| 瑞安市| 凤冈县| 抚松县| 汕头市| 灯塔市| 中山市| 曲阳县| 含山县| 衡东县| 永川市| 巴彦淖尔市| 施秉县| 瓦房店市| 樟树市| 资兴市| 垫江县| 太白县|