1

I am trying to run a coredns plugin https://github.com/coredns/demo that returns 1.1.1.1 for 172.0.0.0/8 or 127.0.0.0/8 and 8.8.8.8 for everything else.

I run the binary and try to make a request from dig using dig example.org @localhost -p1053 +short which returns 1.1.1.1 since the request is sent from localhost

Is there anyway I can send a request from dig to coredns that it might look like to the DNS server that it is sent from another IP and it will return 8.8.8.8 instead?

Palash Nigam
  • 1,653
  • 3
  • 14
  • 26

1 Answers1

3

From dig manual:

   -b address[#port]
       Set the source IP address of the query. The address must be a valid address on one of the host's network interfaces, or "0.0.0.0" or "::". An optional port may be
       specified by appending "#<port>"

Otherwise, if the server supports ECS (EDNS Client Subnet) you can use dig option +subnet=addr to give it to the server and see how its reply changes.

Patrick Mevzek
  • 10,995
  • 16
  • 38
  • 54