1つのバインディングサーバーで親ドメインと子ドメインをホストできますか?

1つのバインディングサーバーで親ドメインと子ドメインをホストできますか?

注:これは再投稿です。私の前の質問、保留され、より明確に説明するために変更するよう依頼しました(これがより理解できるようになります)。


DNSサーバーがインストールされ、すべてのドメインのデバイスが単一のDNSサーバーでDNSクエリを処理できるように、親ドメイン()と2つのサブドメイン(および)をbindホストするように設定しようとしています。example.orgcnc.example.orgreport.example.org

最初の質問は可能ですか?

それでは、なぜ次のエラーが発生しますか?

私が受け取ったドメインnslookup host1でこれを行うときreport.example.org

server can't find host1: SERVFAIL

私が受け取ったドメインnslookup host2でこれを行うときcnc.example.org

server can't find host1: SERVFAIL

ネットワークトポロジ

設定は次のとおりです。

ホスト1:

  • IP 192.168.252.21/24
  • ドメイン名の確認 192.168.252.22
  • /etc/hosts含むhost1.cnc.example.org

ホスト2:

  • IP 192.168.252.20/24
  • ドメイン名の確認 192.168.252.22
  • /etc/hosts含むhost2.report.example.org

DNSサーバー:

  • IP 192.168.252.22/24
  • ドメイン名の確認 127.0.0.1
  • /etc/hosts含むDNSServer.example.org

named.conf.local構成

/
// 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 "example.org" {
    type master;
    file "/etc/bind/zones/example.org";
#    allow-transfer { 192.168.252.22; };
};

zone "cnc.example.org" {
    type master;
    file "/etc/bind/zones/cnc.example.org";
#    allow-transfer { 192.168.252.22; };
};

zone "report.example.org" {
    type master;
    file "/etc/bind/zones/report.example.org";
#    allow-transfer { 192.168.252.22; };
};

zone "252.168.192.in-appr.arpa" {
     type master;
     file "/etc/bind/zones/reverse/rev.252.168.192";
     allow-transfer { 192.168.252.22; };
};

example.org構成

;
; BIND data for example.org or report.example.org
;
$TTL 3h
@           IN  SOA DNSServer.example.org.  root.example.org. (
                        1       ; serial
                        3h      ; refresh
                        1h      ; retry
                        1w      ; expire
                        1h )    ; minimum
;
; main domain name servers - NS records
                    IN  NS  DNSServer.example.org.


; main domain name servers - A records
DNSServer               IN  A   192.168.252.22


;delegated zones
cnc.example.org.                IN  NS  DNSServer.example.org.
report.example.org.         IN  NS  DNSServer.example.org.

*DNSServerの/etc/resolv.conf出力*

  # Generated by NetworkManager
    search example.org
    nameserver 127.0.0.1

*ホスト1の/etc/resolv.conf出力*

 # Generated by NetworkManager
    search report.example.org
    nameserver 192.168.252.22

*ホスト2の/etc/resolv.conf出力*

  # Generated by NetworkManager
    search cnc.example.org
    nameserver 192.168.252.22

* DNSServerのdig DNSServer出力*

root@DNSServer:/etc/bind/zones/reverse# dig DNSServer

; <<>> DiG 9.10.3-P4-Debian <<>> DNSServer
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 45573
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;DNSServer.         IN  A

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Nov 27 10:47:23 GMT 2017
;; MSG SIZE  rcvd: 38

*dig DNSServer.example.org 出力の使用*

   root@DNSServer:/home/osboxes# dig DNSServer.example.org

    ; <<>> DiG 9.10.3-P4-Debian <<>> DNSServer.example.org
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12335
    ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ;; QUESTION SECTION:
    ;DNSServer.example.org.     IN  A

    ;; ANSWER SECTION:
    DNSServer.example.org.  10800   IN  A   192.168.252.22

    ;; AUTHORITY SECTION:
    example.org.        10800   IN  NS  DNSServer.example.org.

    ;; Query time: 0 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
    ;; WHEN: Mon Nov 27 11:01:19 GMT 2017
    ;; MSG SIZE  rcvd: 79

*DNSServerのdig host1出力*

root@DNSServer:/etc/bind/zones/reverse# dig host1

; <<>> DiG 9.10.3-P4-Debian <<>> host1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 19414
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;host1.         IN  A

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Nov 27 10:48:15 GMT 2017
;; MSG SIZE  rcvd: 40

cnc.example.org構成

;
; BIND data for example.org or report.example.org
;
$TTL 3h
@           IN  SOA DNSServer.example.org.  root.example.org. (
                        1       ; serial
                        3h      ; refresh
                        1h      ; retry
                        1w      ; expire
                        1h )    ; minimum
;
; main domain name servers - NS records
@                   IN  NS  DNSServer.example.org.


; main domain name servers - A records
;DNSServer              IN  A   192.168.252.22


;192.168.252.0/24 - A Records
host1.cnc.example.org.      IN  A   192.168.252.21

report.example.org構成

;
; BIND data for example.org or report.example.org
;
$TTL 3h
@           IN  SOA DNSServer.example.org.  root.example.org. (
                        1       ; serial
                        3h      ; refresh
                        1h      ; retry
                        1w      ; expire
                        1h )    ; minimum
;
; main domain name servers - NS records
@                   IN  NS  DNSServer.example.org.

; main domain name servers - A records
DNSServer               IN  A   192.168.252.22

;192.168.252.0/24 - A Records
host2.report.example.org.   IN  A   192.168.252.20

ありがとう

ベストアンサー1

委任を使用できますが、必ずしも必要な場合を除き、単に保ち、およびexample.orgcnc.example.org含む領域を使用することをお勧めしますreport.example.org

;
; BIND data for example.org
;
$TTL 3h
@           IN  SOA DNSServer.example.org.  root.example.org. (
                        1       ; serial
                        3h      ; refresh
                        1h      ; retry
                        1w      ; expire
                        1h )    ; minimum
;
; main domain name servers - NS records
                    IN  NS  DNSServer.example.org.

; main domain name servers - A records
DNSServer           IN  A  192.168.252.22

; public targets
cnc                 IN  CNAME  host1.cnc
report              IN  CNAME  host2.report

; hosts delivering services
host1.cnc           IN  A   192.168.252.21
host2.report        IN  A   192.168.252.20

コメントを引用すると、次のようになります。

DNSサーバーにいるときは、nslookup host1次のようになります。

root@host1:/home/osbixes# nslookup host2
Server: 127.0.0.1
Address 127.0.0.1#53
** server can’t find host2: SERVFAIL

DNSServerには検索パスはありませんが、ドメインはですexample.org。これは、完全修飾されていないすべての名前がそのドメインに存在する必要があることを意味します。あなたの答えが誤って返されhost2.example.orgませんでした。nslookupこの場合は、domain example.orgあなたのもの/etc/resolv.confをに置き換えるsearch example.org report.example.orgかを見つける必要がありますnslookup host2.report

Host1 または Host2 では、次のようになります。

root@host1:/home/osbixes# nslookup host2
Server: 192.168.252.22
Address 192.168.252.22#53
** server can’t find host2: SERVFAIL

同じ理由。ドメイン(検索パス)には含まれているコンポーネントは/etc/resolv.conf含まれていないため、host2どこにも完全nslookup修飾されていない名前は表示されませんhost2

私は、ホスト1とホスト2の/etc/hosts合計ファイルがまだ合計でなければならないと/etc/hostname仮定します。host1.cnc.example.orghost2.report.example.org

/etc/hosts「しなければならない」と言うとき、どういう意味なのかよく分かりませんhost1.cnc.example.org。この/etc/hostsファイルは、ホスト名とIPアドレスをマッピングする別の方法です。ホスト名が2〜3個しかない場合は、内部DNSの複雑さを避け、そのエントリを/etc/hosts。集中型ソリューション。 (しかし、これはnslookup意図的に無視されることを忘れないでください/etc/hosts。)

これにより、どのホストでもnslookup host1.cnc.example.orgIPnslookup host2.report.example.orgアドレスが正しく検証されます。

はい。完全修飾名を指定すると正しく解決されnslookupますbind。これは、DNSの1つが正しく機能していることを証明します。

すべてのクエリを処理するにはDNSサーバーが必要で、新しいexample.orgデバイスがネットワークに通信して新しいコマンドの実行を要求したときcnc.example.orgにクエリを実行する(192.168.252.21)、 )で直接接続します。report.example.orgcnc.example.orghost1.cnc.example.orgreport.example.orghost2.report.example.org

これを行うには、CNAMEDNSの(エイリアス)レコードを使用してクエリをreport.example.orgホストにマッピングしますhost2.report.example.org。あなたの質問にhost2呼び出すべきではない技術的な理由がないことに注意してくださいhost2.example.orgCNAMEレコードは、現在の(サブ)ドメインのホストだけでなく、どこにでも指すことができます。

おすすめ記事