godns icon indicating copy to clipboard operation
godns copied to clipboard

Add a way to query IP address through a specific interface

Open nagisa opened this issue 3 months ago • 1 comments

Describe the bug

I have two uplinks in my system: wan0 and wan1. wan1 is wired, but is behind a CGNAT. wan0 is a backup link to a sattelite, but I get a dynamic IP address to use with this link that's not behind a CGNAT. The routes are set up such that by default packets are routed through (the CGNATed) wan1.

I would like godns to query the IP address through wan0 link specifically, so that it obtains the IP address through which the machine is actually reachable.

The frequency of this issue

  • [ ] This issue is easy to reproduce.
  • [x] This issue is not easy to reproduce. -- requires multiple uplinks

Steps to Reproduce

Obtain two interfaces with a public internet access. Set up the routes such that they read like this:

$ ip route
default dev wan1 proto static scope link metric 1000 
default dev wan0 proto static scope link metric 1001 
...

Your GoDNS configuration

{
  "ip_url": "https://api.ipify.org/",
  "ip_type": "IPv4",
  "debug_info": true,
  "interval": 3600
}

Expected behavior

It should be possible to ask godns to make a request through wan0 specifically (this can be done by binding the TCP socket I believe) so that the machine making the request is actually reachable over the obtained IP address.

Screenshots

N/A

Environment (please complete the following information):

  • DNS Provider: N/A
  • OS: Linux

Additional context
Add any other context about the problem here.

nagisa avatar Mar 14 '24 12:03 nagisa