qualification(5)

πŸ’– qualification(5) β€” bestie's guide to name qualification πŸ’–

okay so this is qualification(5) from the File Formats Manual, and it is literally the glow-up guide for your hostnames. strap in πŸŽ€


✨ NAME ✨

qualification β€” the user's guide to name qualification, aka how your short lil nickname for a computer becomes its whole entire government name 🫢


🌸 OVERVIEW 🌸

so like. qualification is when you type a short host name β€” say cheetah β€” and it gets converted into a complete ("fully qualified") domain name, like cheetah.heaven.af.mil. it's giving nickname β†’ full legal name. iconic. πŸ’…

this page explains the djbdns qualification procedure. these rules are the ones followed by the dns_ip4_qualify library routine in djbdns, and by programs that use the dns_ip4_qualify(3) routine. no cap. ✨


πŸ¦‹ Rewriting instructions πŸ¦‹

normally the djbdns qualification procedure follows the instructions listed in /etc/dnsrewrite, a file created by your system administrator (the group chat admin, basically πŸ‘‘). you can override /etc/dnsrewrite by making your own file and setting the $DNSREWRITEFILE environment variable to the name of that file. main character energy, honestly.

sample instructions:

# anything.local -> me
-.local:me
# me -> 127.0.0.1
=me:127.0.0.1
# any.name.a -> any.name.af.mil
*.a:.af.mil
# any-name-without-dots -> any-name-without-dots.heaven.af.mil
?:.heaven.af.mil
# remove trailing dot
*.:

instructions get followed in order, each one at most once. there are four types of instructions, and yes bestie we are covering all four πŸ’–

  • =post:new β€” means the host name post is replaced by new. that's it. straightforward. slay.
  • *post:new β€” means any name of the form prepost is replaced by prenew. so whatever comes before stays, and the ending gets swapped.
  • ?post:new β€” means any name of the form prepost is replaced by prenew, but only when pre does not contain dots or brackets. so picky, and honestly? valid.
  • -post:new β€” means any name of the form prepost is replaced by new. note the difference from *: here the pre part gets dropped entirely, not kept. πŸ’€ do not mix these up.

πŸ”₯ Searching πŸ”₯

the djbdns qualification procedure can search through DNS for several possible qualifications of a name. for example, the name

cheetah+.heaven.af.mil+.af.mil

is qualified as cheetah.heaven.af.mil if that name has IP addresses listed in DNS, or cheetah.af.mil otherwise. it's like trying on outfits until one actually has plans. πŸŽ€

in general, x+y1+y2+y3 is qualified as xy1 if xy1 has IP addresses listed in DNS; otherwise, as xy2 if xy2 has IP addresses listed in DNS; otherwise, as xy3. you can list any number of +'s. go off. ✨

searching is applied after rewriting, so you can use a rewriting instruction such as

?:+.heaven.af.mil+.af.mil

to have lion qualified as lion.heaven.af.mil or lion.af.mil, and tiger qualified as tiger.heaven.af.mil or tiger.af.mil, and so on. every cat gets a maybe-domain 😭

⚠️ searching is generally not a recommended feature. if you rely on gw being qualified as gw.af.mil, and someone suddenly adds a new gw.heaven.af.mil, you'll end up talking to the wrong host. like texting the wrong number but it's your infrastructure. it's better to rely on syntactic rules that you control. periodt. πŸ’…

🌈 Compatibility mechanisms 🌈

if the rewriting-instructions file does not exist, the djbdns qualification procedure looks for a local domain name in three places, in this order:

  1. the $LOCALDOMAIN environment variable, if it is set; or
  2. the first domain or search line in /etc/resolv.conf, if /etc/resolv.conf exists and has such a line; or
  3. everything after the first dot in the system's hostname.

it then creates rewriting instructions of the form

?:.domain
*.:

so that .domain is added to any name without dots or brackets. cute, right? 🫢

you can specify searching in $LOCALDOMAIN by using several domain names separated by spaces. your system administrator can specify searching in /etc/resolv.conf by putting several domains on a search line. πŸ’œ


⭐ Compatibility notes ⭐

different DNS client programs use different qualification procedures. two major differences between the djbdns qualification procedure and other qualification procedures:

  • most programs use only /etc/resolv.conf. they don't know anything about /etc/dnsrewrite and $DNSREWRITEFILE. not them being oblivious πŸ™ˆ
  • most long-running programs don't notice changes in /etc/resolv.conf; they read /etc/resolv.conf when they start, and they don't reread it until they are restarted. in contrast, the djbdns qualification procedure checks for changes every 10 minutes or 10000 uses. consistency queen πŸ‘‘

two minor differences:

  • some programs interpret a domain line in /etc/resolv.conf as specifying a search list consisting of various suffixes of the domain.
  • many programs will search the local domain for names with dots.

if you want the local domain searched for names with dots, you can set it up with rewriting:

# aol.com -> aol.com or aol.com.heaven.af.mil
*:++.heaven.af.mil
# but skip directly to heaven.af.mil if no dots
?++.heaven.af.mil:.heaven.af.mil

🧚 SEE ALSO 🧚


and that's the whole page bestie!! πŸŽ€ the lil footer at the bottom just says qualification(5) β€” no source/version or date to report, so consider this your sign-off: qualification(5), that's a wrap, mwah πŸ’‹πŸ’–βœ¨

πŸ“¦ where this page comes from