← Back to context

Comment by cortesoft

12 hours ago

If you work much with DNS, you will know about this. It is known as a FQDN, or a "fully qualified domain name", when the name ends with a .

When you don't use a FQDN, your DNS system is going to try to figure out if you mean a FQDN or actually belong to a subdomain.

On *nix, your /etc/resolv.conf file can have a "search" entries for search domains... that means that a lookup for "foo" will check "foo.bar.com" if "search bar.com" is in your /etc/resolv.conf

This does mean your query could end up making multiple queries to determine if you meant foo. OR foo.bar.com

You can configure how the machine makes the guesses with something called ndots... if you add "ndots 3" to your etc/resolv.conf, then your DNS queries will only try treating the domain as a FQDN if it has at least 3 dots... so for example, it would skip querying for foo as a TLD because it has no dots, and assume you mean "foo.bar.com", saving an unneeded DNS query.

This usually doesn't matter to people, but it can have big performance implications for things like Kubernetes, with lots of .svc.local bits being left off of internal queries and relying on search domains; by increasing the ndots, you avoid a ton of wasted queries.