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 ongwbeing qualified asgw.af.mil, and someone suddenly adds a newgw.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:
- the
$LOCALDOMAINenvironment variable, if it is set; or - the first
domainorsearchline in/etc/resolv.conf, if/etc/resolv.confexists and has such a line; or - 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/dnsrewriteand$DNSREWRITEFILE. not them being oblivious π - most long-running programs don't notice changes in
/etc/resolv.conf; they read/etc/resolv.confwhen 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
domainline in/etc/resolv.confas 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
- debian bookworm: djbdns-utils 1:1.05-15+b2 Β· LicenseRef-public-domain
- debian trixie: djbdns-utils 1:1.05-22 Β· LicenseRef-public-domain
- nixos 26.05: djbdns 1.05
- nixpkgs unstable: djbdns 1.05
- ubuntu jammy: djbdns-utils 1:1.05-15fakesync1 Β· LicenseRef-public-domain
- ubuntu noble: djbdns-utils 1:1.05-15ubuntu2 Β· LicenseRef-public-domain
- ubuntu questing: djbdns-utils 1:1.05-22ubuntu1
- ubuntu resolute: djbdns-utils 1:1.05-22ubuntu2 Β· LicenseRef-public-domain
- ubuntu stonking: djbdns-utils 1:1.05-23fakesync1 Β· LicenseRef-public-domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms