read the transcript!
One weird thing about DNS is that different programs on a single computer can get different results for the same domain name.
Let’s talk about why!
Illustration of a program, represented by a box with a smiley face, and a resolver (server), represented by a box with a smiley face holding a magnifying glass. Between them is a function, represented by a rectangle with squiggly lines on it. There are arrows going back and forth between the function and both the program and the resolver (server).
The function is the problem.
reason 1: many (but not all!!) programs use the function getaddrinfo for DNS lookups…
ping, represented by a box with a smiley face: I use getaddrinfo! dig, also represented by a box with a smiley face: I don’t!
So if you see an error message like “
getaddrinfo: nodename or servname not provided...”, that’s a DNS error.
and not using getaddrinfo might give a different result
- the program might not use
- the program might use a different DNS resolver (some browsers do this)
reason 2: there are many different versions of
- the one in
- the one in
- the one in Mac OS
And of course, they all behave slightly differently :)
you can have multiple getaddrinfos on your computer at the same time
For example on a Mac, there’s your system
getaddrinfo, but you might also be running a container that’s using
glibc and musl getaddrinfo are configured with
IP of resolver to use
# Generated by NetworkManager
nameserver fd13: d987:748a::1
On a Mac,
/etc/resolv.conf exists, but it’s not used by the system