This is the situation:
I have a web server on my LAN that serves up beta versions of my documentation for my free software.
This web server, via my router, responds to an external IP address. Imaginary IPs for the purpose of explanation:
- My web server is on my LAN at
- My WAN static IP is
Externally, DNS is not set up so that some name resolves to
184.108.40.206. Nor will it be. So you can't get there the usual way.
So, I provide URLs to my beta testers in this form:
This works fine. My testers out in the world can get to my server and all is good. For them.
Here's the problem: on my machine, if I try to get to that URL, for instance, when I click on a link on a web page that contains it, my machine tells the router to NAT to
220.127.116.11, and that's the end of that - it goes nowhere.
The router does not appear to have any loopback capability to let it know that indeed,
18.104.22.168 is, in fact, on my LAN (although frankly, I think it should know that already, since that's its external IP and that's where I'm trying to get to. It used to work fine on my old router. But anyway.)
So what I'm looking for is a way to tell OS X here on my local machine that when I reach out to
22.214.171.124, I'm actually trying to reach
192.168.10.100 so that my web server will respond to me here on my machine, directly via the LAN.
Simply put, on my machine only, I need the following,...
...to reach here:
Previously, I had my users set up a
hosts file entry for an imaginary servername of the form someweirdname.com, like this...
...and then put all my links up in the form...
...which actually works fine, but ran into a fairly severe user problem where setting up a
hosts file was completely beyond them, hence no access to the docs.
Using the IP requires nothing of the user but clicking the link, and as I said, it works fine for them. But it locks me out, which is highly inconvenient for me - I can't follow URLs out on other web servers back to various places in my beta docs without dragging out my cellphone, turning off its access to wifi, and going after those links via 4G so my router sees the request coming in from outside the LAN.
When I'm just reading my docs here, I just use someweirdname.com to get to them, and it's all relative from there, and that works fine too.
I just can't to them from other server's web pages out on the net. And for... reasons... I need to test those URLs to make sure they go where they are supposed to go.
Is there a solution for this conundrum that doesn't involve buying yet another servername, costing me yet more money to expose my local beta docs, and dealing with the resulting DNS maintainance churn?
I can live with it as it is, and have been, but I hate it.