natesales / q

A tiny command line DNS client with support for UDP, TCP, DoT, DoH, DoQ and ODoH.
GNU General Public License v3.0
1.59k stars 58 forks source link

feature request: custom ip for doh domain #60

Open lessload opened 11 months ago

lessload commented 11 months ago

your apps so good. for some diagnostic use case i need to custom ip for @https://dns.customdomain.net , now i need to custom host file for it. It would be great if your apps support it

rahilarious commented 4 months ago

This could be very easy by editing /etc/hosts file. But it seems since this is a Go package it doesn't respect it. So as a workaround if somebody really want to quickly test specific ip.

  1. edit /etc/hosts with your custom ip for domain (i.e. 2.3.4.5 dns.customdomain.net)
  2. curl --verbose --doh-url https://dns.customdomain.net/dns-query <domain-to-query>
  3. Check the start of output