Skip to content

Add a way to query IP address through a specific interface #238

@nagisa

Description

@nagisa

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.
  • 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.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions