mr-karan / doggo

:dog: Command-line DNS Client for Humans. Written in Golang
https://doggo.mrkaran.dev/
GNU General Public License v3.0
2.83k stars 100 forks source link

Alternative port #106

Closed sergeevabc closed 2 months ago

sergeevabc commented 8 months ago

Dear @mr-karan, my ISP blocks 53 port for queries meant for third-party DNS resolvers, so one has to use alternative ports (e.g. 91.239.100.100:5353), but doggo.exe doesn't seem to have this functionality at the moment. Consider adding optional port param, or even accepting address:port as is. At present, it throws an error as follows

$ doggo.exe 16ao.mathon.fr @91.239.100.100:5353
time="..." level=error msg="error loading nameservers" error="error parsing nameserver: 91.239.100.100:5353"
sergeevabc commented 8 months ago

Err… Hello?

mr-karan commented 7 months ago

It already supports it. doggo 16ao.mathon.fr @udp://91.239.100.100:5353

sergeevabc commented 7 months ago

@mr-karan, but the following command does not work as expected:

$ doggo github.com -n 77.88.8.8:1253
NAME            TYPE    CLASS   TTL     ADDRESS         NAMESERVER
github.com.     A       IN      1648s   140.82.121.4    127.0.0.1:53

Local 127.0.0.1 resolver is used instead of 77.88.8.8:1253.

Even if the port is omitted…

$ doggo github.com -n 77.88.8.8
NAME            TYPE    CLASS   TTL     ADDRESS         NAMESERVER
github.com.     A       IN      1545s   140.82.121.4    127.0.0.1:53
mr-karan commented 7 months ago
doggo github.com @udp://77.88.8.8:1253
NAME        TYPE    CLASS   TTL ADDRESS         NAMESERVER     
github.com. A       IN      32s 140.82.121.3    77.88.8.8:1253
sergeevabc commented 7 months ago

@mr-karan, I'm aware of the syntax you mention, but your app, according to its manual, offers -n switch and that one does not work as expected.

$ doggo

VERSION:
  v0.5.7 (c72c2ef 2023-09-13T10:07:23Z) - unknown

EXAMPLES:

  doggo -q mrkaran.dev -t MX -n 1.1.1.1         Using named arguments.

Query Options:

  -n, --nameserver=ADDR       Address of a specific nameserver to send queries to (9.9.9.9, 8.8.8.8 etc).
mr-karan commented 7 months ago

The -n flag defaults to :53 port and can't be overridden, same as documented. To override you need to use @ with the full format.

Will add support for custom port in -n sometime in future, but not a priority now.

sergeevabc commented 7 months ago

@mr-karan, oh.

But -n in my case defaults not only to port 53, but to a local resolver as well.

$ doggo github.com -n 77.88.8.8
NAME            TYPE    CLASS   TTL     ADDRESS         NAMESERVER
github.com.     A       IN      1545s   140.82.121.4    127.0.0.1:53

whereas it is expected as follows

$ doggo github.com -n 77.88.8.8
NAME            TYPE    CLASS   TTL     ADDRESS         NAMESERVER
github.com.     A       IN      1545s   140.82.121.4    77.88.8.8:53
mr-karan commented 7 months ago

Will check this.

sergeevabc commented 7 months ago

Karan, when you decide to add this feature, please compile Doggo via Go 1.20, because these traitors removed Windows 7 support from Go 1.21.

mr-karan commented 7 months ago

That won't be possible, it won't make sense to compile for an older version.

sergeevabc commented 7 months ago

It is possible, Karan.

A couple of examples when developers used Go 1.20 to compile binaries keeping in mind Windows 7 users:

And it makes sense, Karan, because there are people like me who use and will continue to use Windows 7. It is a polished OS that got all the functions your app need. This determines whether it is time to upgrade or not, not the words of some American company. After all, a hammer hammers nails regardless of whether there is a company that produced it or what that company says, because it is a good hammer.

DaRacci commented 3 months ago

Dude just switch to Linux at this point, you're on an old unsupported operating system which is also no longer receiving security updates.

mr-karan commented 2 months ago
$ ./bin/doggo.bin google.com A -n 1.1.1.1       
NAME            TYPE    CLASS   TTL     ADDRESS         NAMESERVER 
google.com.     A       IN      190s    142.250.71.110  1.1.1.1:53

Will be fixed in next release.