netprobe_lite icon indicating copy to clipboard operation
netprobe_lite copied to clipboard

custom DNS port

Open sazeygit opened this issue 1 year ago • 2 comments

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 :monkey: )

sazeygit avatar Jul 04 '24 06:07 sazeygit

Reviewing now, sorry for delay

plaintextpackets avatar Oct 09 '24 00:10 plaintextpackets

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}

plaintextpackets avatar Oct 09 '24 00:10 plaintextpackets