![DNS 서버가 DNS 쿼리를 자체적으로만 해결하는 이유는 무엇입니까?](https://linux55.com/image/15186/DNS%20%EC%84%9C%EB%B2%84%EA%B0%80%20DNS%20%EC%BF%BC%EB%A6%AC%EB%A5%BC%20%EC%9E%90%EC%B2%B4%EC%A0%81%EC%9C%BC%EB%A1%9C%EB%A7%8C%20%ED%95%B4%EA%B2%B0%ED%95%98%EB%8A%94%20%EC%9D%B4%EC%9C%A0%EB%8A%94%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
dnsmasq를 실행하는 내 DNS 서버에 문제가 있습니다.
이는 다음과 같습니다 /etc/dnsmasq.conf
(주석 처리되지 않은 행만 해당).
# If you don't want dnsmasq to read /etc/resolv.conf or any other
# file, getting its servers from this file instead (see below), then
# uncomment this.
no-resolv
# Add other name servers here, with domain specs if they are for
# non-public domains.
#server=/localnet/192.168.0.1
server=151.100.4.2
server=151.100.4.13
서버에서 쿼리를 해결하려고 하면 모든 것이 정상입니다.
$ nslookup google.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authorative answer:
Name: google.com
Address: 142.250.184.78
Name: google.com
Address: 2a00:1450:4002:405::200e
그러나 ping google.com
네트워크의 다른 호스트에서 시도하면 DNS는 쿼리를 수신하더라도 응답하지 않습니다. 다음은 tcpdump
DNS 서버의 출력입니다.
$ sudo tcpdump -n host 100.100.2.100
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
11:35:43.517755 IP 100.100.2.100.54996 > 100.100.1.2.53: 12795+ A? google.com. (28)
11:35:43.517844 IP 100.100.2.100.54996 > 100.100.1.2.53: 51213+ AAAA? google.com. (28)
11:35:48.522750 IP 100.100.2.100.54996 > 100.100.1.2.53: 12795+ A? google.com. (28)
11:35:48.522818 IP 100.100.2.100.54996 > 100.100.1.2.53: 51213+ AAAA? google.com. (28)
^C
4 packets captured
4 packets received by filter
0 packets dropped by kernel
다른 호스트는 네트워크에 액세스할 수 있습니다. 물론 8.8.8.8 또는 다른 IP로 ping을 보냅니다. 문제는 이름 확인에만 있습니다.
같은 문제가 있는 사람들을 온라인에서 찾아봤지만 아무 것도 찾지 못했습니다. DNS가 작동하는 것처럼 보이고 쿼리를 수신하지만 응답하지 않기 때문에 이 문제를 어떻게 해결해야 할지 잘 모르겠습니다.
답변1
dnsmasq
쿼리는 주소 127.0.0.1(동일 컴퓨터에서만)에서만 응답할 수 있기 때문입니다 .
읽기: -i, --interface=
netstat -4panu
dnsmasq가 수신 대기 중인 포트/i 인터페이스를 찾으려면 루트로 확인하세요 .