ACCF_DNS(9)
π ACCF_DNS π β the accf_dns manual, but make it make sense
okay bestie, welcome to ACCF_DNS(9), straight outta the Kernel Developer's Manual β¨ this is the DNS accept filter and she is so much chiller than she sounds.
β¨ NAME β¨
accf_dns β buffer incoming DNS requests until the whole first request is present π
π¦ SYNOPSIS π¦
options INET
options ACCEPT_FILTER_DNS
kldload accf_dns
like, three whole lines. that's the whole vibe. π
πΈ DESCRIPTION πΈ
Okay so picture this: you've got a socket, and it's gonna use accept() to receive incoming connections. This filter? You place it on that socket. That's her whole job. Placed on a socket. Slay. π
Here's the tea though β it stops the application from receiving the connected descriptor via accept() until a whole DNS request is available on the socket. Not a partial one. Not half a request. The WHOLE thing. periodt.
How does she know when the whole thing's arrived? She reads the first two bytes of the request to figure out its size, then she just⦠waits. Sits there, patiently, like a good friend holding your coffee, until the required amount of data is available to be read. 𫢠So iconic.
Oh and also β the ACCEPT_FILTER_DNS kernel option is also a module, which means you can enable it at runtime via kldload(8) if the INET option has been compiled into the kernel. Double duty. Main character energy fr fr. π₯
π EXAMPLES π
So if the accf_dns module is available in the kernel, this code right here will enable the DNS accept filter on a socket sok:
struct accept_filter_arg afa;
bzero(&afa, sizeof(afa));
strcpy(afa.af_name, "dnsready");
setsockopt(sok, SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa));
look at that. "dnsready". it's giving prepared. ππ
π SEE ALSO π
go read the whole friend group, they're all linked π
π HISTORY π
The accept filter mechanism was introduced in FreeBSD 4.0. old money. vintage. we love a legacy icon. β
π§ AUTHORS π§
This manual page and the filter were written by David Malone. thank you for your service king π«‘π
okay that's the whole page bestie, no notes π
This was ACCF_DNS(9) from the Debian build, dated July 16, 2008 β yeah she's been around a minute, and she still ate. bye pookie, go buffer those DNS requests π
β¨
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2008 David Malone
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms