BLACKLISTD.CONF(5)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’… BLACKLISTD.CONF(5) β€” the blacklistd.conf file format, bestie edition

Okay so this is the blacklistd.conf(5) page β€” yes, section 5, file formats, we're in the config weeds today and honestly? iconic. This file is where you tell blacklistd who to block, how hard, and for how long. Let's get into it 🫢


✨ NAME ✨

blacklistd.conf β€” the configuration file format for blacklistd πŸ’–

🌸 DESCRIPTION 🌸

The blacklistd.conf file holds all the configuration entries for blacklistd(8), and it's set up in a fashion similar to inetd.conf(5). Vibes: retro but functional.

Ground rules, no cap:

  • Only one entry per line is permitted. One line = one whole thought.
  • Every entry must have all fields populated. No half-finished entries, we don't do that here πŸ™ˆ
  • Each field can be separated by a tab or a space β€” either slaps.
  • Comments are denoted by a β€œ#” at the beginning of a line. Put a # at the start and the line is just a little note to yourself ✨

There are two kinds of configuration lines: [local] and [remote]. By default, configuration lines are [local] β€” meaning the address you specify refers to the addresses on the local machine. To switch between [local] and [remote] configuration lines you can specify the stanzas: β€œ[local]” and β€œ[remote]”. Literally just drop the stanza in and everything after it switches teams πŸ¦‹

On [local] and [remote] lines, β€œ*” means use the default, or wildcard match β€” your pick, it's serving both. In addition, for [remote] lines, β€œ=” means use the values from the matched [local] configuration line. Chef's kiss inheritance, we love to see it πŸ‘‘

The first four fields β€” location, type, proto, and owner β€” are used to match the [local] or [remote] addresses. The last 3 fields β€” name, nfail, and disable β€” are used to modify the filtering action. Matchy bits first, action bits after πŸ’…

πŸŽ€ the location field

The first field denotes the location as an address, mask, and port. The syntax for the location is:

[<address>|<interface>[/<mask>]:]<port>

The address can be:

  • an IPv4 address in numeric format,
  • an IPv6 address in numeric format and enclosed by square brackets, or
  • an interface name.
⚠️ Mask modifiers are not allowed on interfaces, because interfaces can have multiple addresses in different protocols where the mask has a different size. It's giving "it's complicated" 😭

The mask is always numeric, but the port can be either numeric or symbolic. Slay, flexible port.

πŸ¦‹ the type, proto, and owner fields

  • The second field is the socket type: stream, dgram, or numeric.
  • The third field is the protocol: tcp, udp, tcp6, udp6, or numeric.
  • The fourth field is the effective user (owner) of the daemon process reporting the event, either as a username or a userid.

🧚 the filter-behavior fields

The rest of the fields control the behavior of the filter. Main character energy, honestly.

The name field is the name of the packet filter rule to be used. Two little special behaviors to know about:

  • If the name starts with a hyphen (β€œ-”), then the default rulename is prepended to the given name.
  • If the name contains a β€œ/”, the remaining portion of the name is interpreted as the mask to be applied to the address specified in the rule β€” causing a single rule violation to block the entire subnet for the configured prefix. One boop, whole subnet blocked πŸ”₯

The nfail field contains the number of failed attempts before access is blocked, defaulting to β€œ*” meaning never. And the last field, duration, specifies the amount of time since the last access that the blocking rule should be active, defaulting to β€œ*” meaning forever. The default unit for duration is seconds, but one can specify suffixes for different units, such as β€œm” for minutes, β€œh” for hours and β€œd” for days. Tiny letters, big consequences πŸ’€

πŸ’œ how matching actually goes down

Matching is done first by checking the [local] rules individually, in the order of the most specific to the least specific. If a match is found, then the matching [remote] rules are applied. The name, nfail, and duration fields can be altered by the [remote] rule that matched. So the remote rule gets the final say on those three, iykyk 🌈

The [remote] rules can be used for:

  • allowing specific addresses,
  • changing the mask size (via name),
  • the rule that the packet filter uses (also via name),
  • the number of failed attempts (via nfail), or
  • the duration to block (via duration).

πŸ“ FILES πŸ“

  • /etc/blacklistd.conf β€” Configuration file. That's the one, bestie πŸ“

⭐ EXAMPLES ⭐

        # Block ssh, after 3 attempts for 6 hours on the bnx0 interface
        [local]
        # location      type    proto   owner   name    nfail   duration
        bnx0:ssh        *       *       *       *       3       6h
        [remote]
        # Never block 1.2.3.4
        1.2.3.4:ssh     *       *       *       *       *       *
        # Never block the example IPv6 subnet either
        [2001:db8::]/32:ssh     *       *       *       *       *       *
        # For addresses coming from 8.8.0.0/16 block whole /24 networks instead
        # individual hosts, but keep the rest of the blocking parameters the same.
        8.8.0.0/16:ssh  *       *       *       /24     =       =

Obsessed with the /24 + = + = combo β€” "keep everything else the same, just make the mask bigger." Rude but efficient πŸ’…

πŸ¦‹ SEE ALSO πŸ¦‹

blacklistctl(8), blacklistd(8) β€” go read these next, they're the whole ecosystem 🫢

πŸ’€ NOTES πŸ’€

Heads up: the blacklistd.conf file has been renamed to blocklistd.conf(8). So if you went looking and the name was different, that's why β€” you're not losing it, promise πŸ™ˆ

πŸ‘‘ HISTORY πŸ‘‘

blacklistd.conf first appeared in NetBSD 7. FreeBSD support for blacklistd.conf was implemented in FreeBSD 11. A whole glow-up timeline, honestly ✨

🌈 AUTHORS 🌈

Christos Zoulas β€” thank you for your service, king 🫑


that's the whole page, no skips, no summaries, every single flag and stanza intact πŸ’– This was brought to you by the Debian flavour of the page, dated January 13, 2026 β€” BLACKLISTD.CONF(5), File Formats Manual, signing off πŸŽ€βœ¨

πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms