Skip to content

[dnsdist] Add ECS client-subnet information to self-generated answers #9951

@fateyev

Description

@fateyev
  • Program: dnsdist
  • Issue type: Feature request

Short description

Currently, dnsdist self-generated responses don't include ECS client-subnet information, even if the query was with it, e.g.
dig @server jhgjhgjhgjh.com +subnet=1.2.3.4

Usecase

From google public DNS docs:
"3. Authoritative name servers that implement ECS must respond to all ECS queries with ECS responses, including negative and referral responses."

Powerdns will always answer with ECS if query includes it, but dnsdist not.

Description

Last rule in config:
addAction(AllRule(), RCodeAction(dnsdist.NXDOMAIN))

Current behaviour:

$ dig @localhost xsgsgsghlkjkj.com +subnet=1.1.1.1

; <<>> DiG 9.16.1-Ubuntu <<>> @localhost xsgsgsghlkjkj.com +subnet=1.1.1.1
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 4800
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1500
;; QUESTION SECTION:
;xsgsgsghlkjkj.com.		IN	A

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Вт янв 12 13:51:06 MSK 2021
;; MSG SIZE  rcvd: 46

Expected behaviour:

$ dig @localhost xsgsgsghlkjkj.com +subnet=1.1.1.1

; <<>> DiG 9.16.1-Ubuntu <<>> @localhost xsgsgsghlkjkj.com +subnet=1.1.1.1
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 4800
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1500
; CLIENT-SUBNET: 1.1.1.1/32/0
;; QUESTION SECTION:
;xsgsgsghlkjkj.com.		IN	A

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Вт янв 12 13:51:06 MSK 2021
;; MSG SIZE  rcvd: 46

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions