Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make DNS queries case insensitive #793

Merged
merged 1 commit into from
Dec 20, 2022

Conversation

johnmaguire
Copy link
Collaborator

@johnmaguire johnmaguire commented Dec 13, 2022

Convert hostnames to lowercase during map insertion and lookup.

Fixes #776.

Manually tested...

INFO[0000] Starting DNS responder                        dnsListener="0.0.0.0:53"
INFO[0005] Handshake message received                    certName=NoDe1 fingerprint=71544988eed070f0599ce8627918479be60f493b2c729d5abb85fb025e9d0330 handshake="map[stage:1 style:ix_psk0]" initiatorIndex=3501997041 issuer=0e1f5f42920c4e24c12496c4
d0f199ecbe0fff92bda4edac352ebd6c2eb7ce84 remoteIndex=0 responderIndex=0 udpAddr="127.0.0.1:58582" vpnIp=192.168.128.2
INFO[0005] Handshake message sent                        certName=NoDe1 fingerprint=71544988eed070f0599ce8627918479be60f493b2c729d5abb85fb025e9d0330 handshake="map[stage:2 style:ix_psk0]" initiatorIndex=3501997041 issuer=0e1f5f42920c4e24c12496c4
d0f199ecbe0fff92bda4edac352ebd6c2eb7ce84 remoteIndex=0 responderIndex=743908020 sentCachedPackets=0 udpAddr="127.0.0.1:58582" vpnIp=192.168.128.2
❯ dig @127.0.0.01 nOdE1

; <<>> DiG 9.10.6 <<>> @127.0.0.01 nOdE1
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20643
;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;nOdE1.				IN	A

;; ANSWER SECTION:
nOdE1.			3600	IN	A	192.168.128.2

;; Query time: 9 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Dec 13 15:02:37 EST 2022
;; MSG SIZE  rcvd: 44

❯ dig @127.0.0.01 NODE1

; <<>> DiG 9.10.6 <<>> @127.0.0.01 NODE1
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25154
;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;NODE1.				IN	A

;; ANSWER SECTION:
NODE1.			3600	IN	A	192.168.128.2

;; Query time: 8 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Dec 13 15:02:39 EST 2022
;; MSG SIZE  rcvd: 44

Copy link
Collaborator

@jasikpark jasikpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

ig this could increase the number of duplicate hostnames if someone has a network w/ names that are only differing in case, though this is arguably a bugfix, it makes sense as a breaking change

@johnmaguire johnmaguire merged commit c44da3a into slackhq:master Dec 20, 2022
@johnmaguire johnmaguire deleted the case-insensitive-dns branch December 20, 2022 21:59
@wadey wadey added this to the v1.7.0 milestone Feb 20, 2023
apeters1827 pushed a commit to oneclick-ag/nebula that referenced this pull request Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG: DNS Case Sensitivity
4 participants