Skip to content

Read/write raw responses #443

@Anuskuss

Description

@Anuskuss

I think It would be pretty useful if you could read/write "raw" data from/into responses.

  1. Read data
[groups.nocache]
type      = "ttl-modifier"
ttl-max   = 1 # 0 doesnt seem to work yet
resolvers = [ "cloudflare" ] # this doesnt run if called by "dnsflag"

[group.dnsflag]
type      = "raw-read"
resolvers = [ "cloudflare" ]                           # get the response
match     = { dns-flags = [ "QR", "RD", "RA", "AD" ] } # if: response contains AD
action    = [ "nocache" ]                              # then: do this
  1. Write data
[groups.ednsflag]
type      = "raw-write"
resolvers = [ "cloudflare" ]          # get the response
add       = { edns-flags = [ "DO" ] } # add/overwrite
rem       = { type = "RRSIG" }        # remove if exists

Both could be combined to do something like this:

# Turn SERVFAIL into NXDOMAIN
[groups.nxdomain-write]
type      = "raw-write"
resolvers = [ "cloudflare" ]
add       = { status = "NXDOMAIN" }
rem       = { error = "EDE" }

[group.servfail-read]
type      = "raw-read"
resolvers = [ "cloudflare" ]
match     = { status = "SERVFAIL" }
action    = [ "nxdomain-write" ]

In this example you could also just use static-responder though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions