knadh / dns.toys

A DNS server that offers useful utilities and services over the DNS protocol. Weather, world time, unit conversion etc.
https://www.dns.toys
MIT License
2.48k stars 135 forks source link

fix: ip parsing #28

Closed mr-karan closed 2 years ago

mr-karan commented 2 years ago

Instead of doing a strings.Split on RemoteAddr which didn't work for IPv6, this commit addresses that by using net.SplitHostPort. It gets the underlying IP representation from the host string and returns IPv4/IPv6 address.

Fixes https://github.com/knadh/dns.toys/issues/27