Skip to content

Conversation

@sazeygit
Copy link

@sazeygit sazeygit commented Jul 4, 2024

Hello and thank you for putting this together in the first place.

I added ability to test the custom DNS server on a port other than 53 by specifying a new DNS_SERVER_PORT variable in .env. This variable is passed to Config_Netprobe() which then passes it to NetworkCollector(), and is finally passed to dnstest() function. my_resolver() has a nameserver_ports() function which conveniently maps custom DNS IP addresses to our port passed as dict.

Also updated README.md and added comments where appropriate.

Tested before uploading on Arch and Alpine.

(my first pull request, please take it easy on me 🐒 )

@sazeygit sazeygit marked this pull request as ready for review July 4, 2024 06:59
@sazeygit sazeygit changed the title custom DNS port feature commit custom DNS port Jul 4, 2024
@sazeygit sazeygit marked this pull request as draft July 4, 2024 07:02
@sazeygit sazeygit marked this pull request as ready for review July 4, 2024 07:10
@plaintextpackets
Copy link
Owner

Reviewing now, sorry for delay

@plaintextpackets
Copy link
Owner

So I ran this locally, changed the port to udp 54, but the tool kept working:

DNS_SERVER_PORT="54" # DNS server 4 port

... even though I don't have a DNS server on port 54. I also did a tcpdump to look for traffic on UDP 54 and didn't find any.

sudo tcpdump -i any udp port 54

I would check these lines:

    my_resolver.nameserver_ports = {self.nameservers[3] : self.dns_port}

To make sure that dns.resolver takes the option of the port you're giving:

 # custom port mapping
    my_resolver.nameserver_ports = {self.nameservers[3] : self.dns_port}

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.

2 participants