Score:0

Bind9 one spf record for all zones

lc flag

I want to create one include with SPF IP address to be used from all dns zones in my server. Can you suggest me how to do it? I work on BIND9. Thank you.

Score:0
la flag

There are two approaches:

  • The bind zone file syntax provides an $INCLUDE statement to "include" content/resource records from a different file into the zone.

See for example: https://www.zytrax.com/books/dns/ch8/include.html where the zone file for the uk.example.com zone includes a second file /var/named/include.txt

$ORIGIN uk.example.com.
@          IN      NS     ns2.example.com. 
; ns2.example.com services uk.example.com

$INCLUDE /var/named/include.txt ; absolute path
...
ftp        IN      A   192.168.35.16

That second file, /var/named/include.txt can then be something like:

  # when this /var/named/include.txt is included 
  # it sets up a generic SPF record for the zone

  @   IN  TXT "v=spf1 a mx ip4:10.9.8.7 -all 

  # EOF /var/named/include.txt
  • The alternative approach uses the native SPF include directive to include the SPF record values from another domain:

      "v=spf1 a mx include:example.com. -all 
    
  • A similar alternative approach uses the native SPF redirect directive to use the SPF record from another domain:

      "v=spf1 redirect=example.com
    

Both the native SPF methods come with their own caveats, explained here: https://dmarcian.com/spf-syntax-table/

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.