DNSサーバーがDNSクエリを独自に解決するのはなぜですか?

DNSサーバーがDNSクエリを独自に解決するのはなぜですか?

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はクエリを受信して​​も応答しません。以下はtcpdumpDNS サーバーの出力です。

$ 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 -4panudnsmasqがリッスンしているポート/ iインターフェイスを見つけるには、rootとして確認してください。

おすすめ記事