우분투, BIND9 및 이름 확인

우분투, BIND9 및 이름 확인

home.twelsh.co.uk 도메인의 기본 이름 서버로 Ubuntu 22.04 LTS 서버에 BIND9를 설치했습니다. apt를 통해 설치되며 구성 파일은 다음 위치에 있습니다.디지털 오션 사용법

클라이언트 PC에서 마이닝 요청을 하면 네임서버에 대한 정답이 나옵니다.

twelsh@builder-box:~$ dig @192.168.0.86 NS home.twelsh.co.uk

; <<>> DiG 9.18.18-0ubuntu0.22.04.2-Ubuntu <<>> @192.168.0.86 NS home.twelsh.co.uk
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20315
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 3

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: 5e4f9d4078dbda280100000065d90bd4e2ffc3f2dc27663a (good)
;; QUESTION SECTION:
;home.twelsh.co.uk.             IN      NS

;; ANSWER SECTION:
home.twelsh.co.uk.      300     IN      NS      ns1.home.twelsh.co.uk.
home.twelsh.co.uk.      300     IN      NS      ns2.home.twelsh.co.uk.

;; ADDITIONAL SECTION:
ns1.home.twelsh.co.uk.  300     IN      A       192.168.0.86
ns2.home.twelsh.co.uk.  300     IN      A       192.168.0.88

;; Query time: 0 msec
;; SERVER: 192.168.0.86#53(192.168.0.86) (UDP)
;; WHEN: Fri Feb 23 21:19:16 UTC 2024
;; MSG SIZE  rcvd: 142

호스트 calvin에 대해 동일한 작업을 수행하면 다음과 같은 결과가 표시되며 이름은 표시되지만 관련 IP 주소는 표시되지 않습니다. 누구든지 내가 어디로 잘못 가고 있는지 말해 줄 수 있습니까? 머리카락을 뽑고 있어요.

읽고 또 읽었습니다이 기사하지만 여전히 문제가 있습니다. -

twelsh@builder-box:~$ dig @192.168.0.86 A calvin

; <<>> DiG 9.18.18-0ubuntu0.22.04.2-Ubuntu <<>> @192.168.0.86 A calvin
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 7947
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: 751c6a8a04abd91b0100000065d90ad04417a14eccdffc7f (good)
;; QUESTION SECTION:
;calvin.                                IN      A

;; AUTHORITY SECTION:
.                       10800   IN      SOA     a.root-servers.net. nstld.verisign- 
grs.com. 2024022301 1800 900 604800 86400

;; Query time: 32 msec
;; SERVER: 192.168.0.86#53(192.168.0.86) (UDP)
;; WHEN: Fri Feb 23 21:14:56 UTC 2024
;; MSG SIZE  rcvd: 138

내가 아는 한 내 영역 파일은 괜찮습니다.

twelsh@ns1:~$ sudo named-checkzone home.twelsh.co.uk 
/etc/bind/zones/db.home.twelsh.co.uk
zone home.twelsh.co.uk/IN: loaded serial 11
OK

그리고 내 역방향 조회

twelsh@ns1:~$ sudo named-checkzone 0.168.192.in-addr.arpa /etc/bind/zones/db.192.168.0
zone 0.168.192.in-addr.arpa/IN: loaded serial 10
OK

내 영역 및 역방향 조회 파일은 다음과 같습니다. /etc/bind/zones/db.home.twelsh.co.uk

;; Optimized BIND9 Forward Zone File
$ORIGIN home.twelsh.co.uk.
$TTL    5m

@       IN SOA  ns1.home.twelsh.co.uk root.home.twelsh.co.uk. (
                  11          ; Serial   
                  7d        ; Refresh
                  1d        ; Retry
                  28d       ; Expire
                  7d )        ; Minimum TTL

       IN NS  ns1.home.twelsh.co.uk.
       IN NS  ns2.home.twelsh.co.uk.

n8n               IN A 192.168.0.79
builder-box       IN A 192.168.0.82
dev-server        IN A 192.168.0.83
staging-server    IN A 192.168.0.84
ns1               IN A 192.168.0.86
ns2               IN A 192.168.0.88
calvin            IN A 192.168.0.89

리버스 존 파일

$ORIGIN 0.168.192.in-addr.arpa.
$TTL    5m
@       IN      SOA  home.twelsh.co.uk. root.home.twelsh.co.uk. (
                     10          ; serial number incrementation example here
                     7d         ; refresh interval
                     1d         ; retry interval
                     28d        ; expiry time
                     7d )       ; minimum cache lifetime

        IN  NS  ns1.home.
        IN  NS  ns2.home.

86      IN  PTR  ns1.home.
88      IN  PTR  ns2.home.

79      IN  PTR  n8n.home.
82      IN  PTR  builder-box.home.
83      IN  PTR  dev-server.home.
84      IN  PTR  staging-server.home.
86      IN  PTR  ns1.home.
88      IN  PTR  ns2.home.
89      IN  PTR  calvin.home.

/etc/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 "home.twelsh.co.uk" {
    type master;
    file "/etc/bind/zones/db.home.twelsh.co.uk"; # zone file path
    allow-transfer {192.168.0.88; };             # ns2 private IP address - secondary
};


zone "0.168.192.in-addr.arpa" {
    type master;
    file "/etc/bind/zones/db.192.168.0.0";  # 192.168.0.0/24 subnet
    allow-transfer { 192.168.0.88; };       # ns2 private IP address - secondary
};

관련 정보