read the transcript!
In an internal network (like in a company or school), sometimes you can connect to a machine by just typing its name, like this:
$ ping labcomputer-23
Let’s talk about how that works!
many DNS lookup functions support “local” domain names
browser, represented by a box with a smiley face: where’s lab23?
function, represented by a rectangle with squiggly lines: where’s lab23.degrassi.ca?
arrow pointing to resolver (server) represented by a box with a smiley face holding a magnifying glass
(the function appends a base domain
degrassi.ca to the end)
the base domain is called a “search domain”
On Linux, search domains are configured in
getaddrinfo to turn
getaddrinfo doesn’t always use search domains
It uses an option called ndots to decide.
this means “only use search domains if the domain name contains less than 5 dots”
search domains can make DNS queries slower
getaddrinfo, represented by a rectangle with squiggly lines: okay, first I’ll try
this is silly but it can happen!
avoid search domains by putting a “.” at the end
http://jvns.ca. instead of
Illustration of a smiling stick figure with curly hair.
person: “local” domain names like this mostly exist inside of big institutions like universities