Skip to content
Discussion options

You must be logged in to vote

To answer the follow-up: yes, that's the workflow, and you can keep using a file. The easy way is to wrap it in a function you can call from the console, so a reload is a single command. Name the rule so rmRule can find it by name instead of by position.

In your config:

local SUFFIX_FILE = "/etc/dnsdist/suffixes.txt"   -- one domain per line

function reloadSuffixRule()
  local smn = newSuffixMatchNode()
  for line in io.lines(SUFFIX_FILE) do
    line = line:gsub("%s+", "")
    if line ~= "" and line:sub(1, 1) ~= "#" then
      smn:add(line)
    end
  end
  rmRule("suffix-list")   -- harmless the first time, when it doesn't exist yet
  addAction(SuffixMatchNodeRule(smn, true), RCodeAction(D…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@vecinohk
Comment options

Comment options

You must be logged in to vote
1 reply
@vecinohk
Comment options

Answer selected by vecinohk
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
3 participants