Почему nslookup не использует mdns, в то время как ping делает?

Заставьте всех проверять под их столами и поскольку Вы включаете их, они могут выкрикнуть, когда их свет прибывает on*. (Только полезный, если у Вас есть офис открытой планировки).


*С другой стороны, заставьте всех проверять под их столами, затем затем оставлять пост и видеть, сколько времени он берет их для замечания :)

9
задан 5 March 2014 в 14:24
2 ответа

ping use glibc's name resolution system, called Name Service Switch. This uses the /etc/nsswitch.conf file to know where to look for in order to resolve a name to an IP. The hosts: line in this file represents an order of preference for each service. For exemple, files represent the local /etc/hosts file, dns uses the /etc/resolv.conf file to contact a DNS server, and mdns uses mdns.

However, nslookup doesn't use it. It talks directly to the DNS server specified in /etc/resolv.conf and so can't use mdns.

But I can't answer your last question. If you have both mdns and dns in /etc/nsswitch.conf, even with mdns first, it should firstly try to resolve the name with mdns, then if no answer use dns.

8
ответ дан 2 December 2019 в 22:30

It's very simple - nslookup is specifically a DNS tool - it's part of the BIND tools.

It simply doesn't know about the other name services that library calls such as gethostbyname can access via NSS because nslookup doesn't use gethostbyname, etc.

3
ответ дан 2 December 2019 в 22:30

Теги

Похожие вопросы