dig command parsing for EDNS Client Subnet
Summary
Setting up a LAB Environment to test EDNS Client Subnet Identification. Dig fails to parse EDNS option when port (other than 53) is used
-p port Send the query to a non-standard port on the server, instead of the default port 53. This option would be used to test a name server that has been configured to listen for queries on a non-standard port number.
BIND version used
BIND 9.11.4-P2-RedHat-9.11.4-26.P2.el7_9.9 (Extended Support Version) id:7107deb
DiG 9.11.4-P2-RedHat-9.11.4-26.P2.el7_9.9
Also observed on OL7.
Steps to reproduce
Have a DNS daemon on port 53 and another on port 8053
What is the current bug behavior?
# dig @localhost -p 8053 public.disney.com.edgesuite.net. +subnet=1.2.3.4/24
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.el7_9.9 <<>> @localhost -p 8053 public.disney.com.edgesuite.net. +subnet=1.2.3.4/24
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45110
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;public.disney.com.edgesuite.net. IN A
;; ANSWER SECTION:
public.disney.com.edgesuite.net. 20667 IN CNAME a1398.dscf1.akamai.net.
a1398.dscf1.akamai.net. 20 IN A 95.100.100.104
a1398.dscf1.akamai.net. 20 IN A 95.100.100.65
;; Query time: 4 msec
;; SERVER: ::1#8053(::1)
;; WHEN: Thu Sep 08 14:46:21 WEST 2022
;; MSG SIZE rcvd: 125
What is the expected correct behavior?
# dig @localhost -p 53 public.disney.com.edgesuite.net. +subnet=1.2.3.4/24
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.el7_9.9 <<>> @localhost -p 53 public.disney.com.edgesuite.net. +subnet=1.2.3.4/24
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25452
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; CLIENT-SUBNET: 1.2.3.0/24/0
;; QUESTION SECTION:
;public.disney.com.edgesuite.net. IN A
;; ANSWER SECTION:
public.disney.com.edgesuite.net. 21351 IN CNAME a1398.dscf1.akamai.net.
a1398.dscf1.akamai.net. 20 IN A 95.100.100.65
a1398.dscf1.akamai.net. 20 IN A 95.100.100.104
;; Query time: 20 msec
;; SERVER: ::1#53(::1)
;; WHEN: Thu Sep 08 14:47:01 WEST 2022
;; MSG SIZE rcvd: 136
Relevant configuration files
N/A
Relevant logs and/or screenshots
N/A
Possible fixes
N/A