Re:How to use dig
by nonsequitur on Saturday December 04, 2021 @12:55PM
(#29442677)
You can directly query `getaddrinfo` with
getent ahosts myhost
Re:How to use dig
by indigodaddy on Saturday December 04, 2021 @03:35PM
(#29444074)
Thanks for this. I’ve always wanted to know how to replicate how the OS is resolving.
The OS X equivalent is: dscacheutil -q host -a name MYHOST
Re:How to use dig
by globular-toast on Saturday December 04, 2021 @06:30PM
(#29445292)
This has confused me before when trying to lookup mDNS/avahi/.local names. You can't use dig, host etc. to look them up because the answer doesn't come from a DNS server, but you can ping them.
Re:How to use dig
by formerly_proven on Saturday December 04, 2021 @01:18PM
(#29442899)
If you have a particularly bad ISP or are on a controlled network, dig might not use the specified DNS server because the network is intercepting outgoing DNS traffic.
Edit: It's not necessarily something to be worried about, just that "strange results" may occur if unaware. E.g. "why and how does 8.8.8.8 resolve a domain-local host?"
If you’re concerned about network interception and lack the ability to have a trusted ISP, then WireGuard your connection to a trusted endpoint (you should probably route everything over it). Normally you’d want your devices to use your pi hope so you can block malicious traffic (adverts, trackers etc) from all your devices.
Re:How to use dig
by da_chicken on Saturday December 04, 2021 @02:45PM
(#29443712)
That's not really a dig problem.
Re:How to use dig
by 1vuio0pswjnm7 on Saturday December 04, 2021 @05:30PM
(#29444902)
Sometimes, I want to see the results from getaddrinfo, which are impacted by caching on the host itself and/or OS-specific configuration settings that dig and host know nothing about. (scutil --dns on macOS, systemd-resolvedand nscd on Linux, etc.)
In that case, I usually use ping. e.g., waiting for a DNS change to propagate to a host, I might use: