• 0 Posts
  • 39 Comments
Joined 1 year ago
cake
Cake day: June 10th, 2023

help-circle








  • Edit: misunderstood what OP wanted to do, leaving this here in case it’s interesting to anyone.

    Sounds like what you are tyring to do is called Split Horizon DNS.

    Requests from outside your network should resolve server.domain.com to the public IP, but requests from inside your network should resolve it to the private IP.

    If that’s what it is then you register the public IP with your nameservers. You also run a DNS service internally which you point all your computers at (likely by putting it as the DNS server in your networks DHCP settings). That DNS server is set up to return the private ip addresses for all your servers, and to forward any other requests to some external DNS like 1.1.1.1

    I’m not sure what your use case or for needing to use the internal IP address from inside the network, but it might be to avoid traffic exiting your network just to be sent back in? Or you me a that you want external requests to go to one server and internal to go to another server? I’m which case the set up above still works, but on just use the appropriate IP addresses in the appropriate places.