
외부 DNS 서버 역할을 할 DNS를 설정했습니다. 모든 설정은 기본값이며 관리자는 /var/named/named.ca 아래에 있는 루트 힌트 파일을 사용하라고 지시했습니다. 그리고 루트 영역은 /etc/named.conf 파일에 언급되어 있습니다.
options {
listen-on port 53 { 127.0.0.1; 192.168.161.1; };
#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";
recursing-file "/var/named/data/named.recursing";
secroots-file "/var/named/data/named.secroots";
allow-query { any; };
filter-aaaa-on-v4 yes;
#OPTIONS = "-4"
/*
- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
- If you are building a RECURSIVE (caching) DNS server, you need to enable
recursion.
- If your recursive DNS server has a public IP address, you MUST enable access
control to limit queries to your legitimate users. Failing to do so will
cause your server to become part of large scale DNS amplification
attacks. Implementing BCP38 within your network would greatly
reduce such attack surface
*/
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
명명된 서비스를 다시 시작했지만 도메인 시스템에 대해 ping을 수행해도 문제를 해결할 수 없습니다.
Google DNS를 제거한 후
"127.0.0.1" 및 "192.168.161.1"을 추가하고 네트워크 서비스를 다시 시작하면. google.com @localhost를 검색해 보세요. 이런 답장을 해준다
dig google.com @localhost
; <<>> DiG 9.9.4-RedHat-9.9.4-72.el7 <<>> google.com @localhost
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 24654
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;google.com. IN A
;; Query time: 4001 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Mar 22 16:46:48 +03 2020
;; MSG SIZE rcvd: 39
답변1
우선, ping
DNS 문제를 진단하는 가장 좋은 방법은 아닙니다. 당신이 원하는 dig
:
shadur@vigil:~$ dig google.com @localhost
; <<>> DiG 9.10.3-P4-Debian <<>> google.com @localhost
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55786
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;google.com. IN A
;; ANSWER SECTION:
google.com. 22 IN A 216.58.211.110
;; Query time: 90 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Mar 22 14:02:39 CET 2020
;; MSG SIZE rcvd: 55
이렇게 하면 아직 도움이 되지 않더라도 무엇이 잘못되었는지 파악하는 데 도움을 주려는 사람들에게 더 많은 정보를 제공할 수 있는 훨씬 더 많은 정보가 생성됩니다.
두 번째로, 거기에 게시한 구성 조각과 수행하려는 작업에 대한 설명으로 판단하면 문제는 다음과 같습니다.
recursion no;
이는 BIND9에게 내부 알려진 목록(바로 위의 설명이 AUTHORITATIVE 서버라고 함)에 있는 도메인에 대한 쿼리에만 응답해야 함을 알려주고 ping 시도로 수행하려는 작업을 설명하는 것은 우리에게 반복 서버.
(일반적으로 동일한 시스템에서 두 가지를 모두 실행하는 것은 권장되지 않습니다. 또는 누구를 반복할지 매우 조심하기 위해 실행하는 경우 개방형 반복자는 네트워크에 나쁜 소식입니다.)
pdns-recursor
또한 위의 내용이 너무 기술적이어서 이해하기 어려울 경우 다음에서 설치하는 것이 좋습니다.파워DNS대신 프로젝트를 진행하세요.