I’ve been using WordPress for a while now, and I’m doing development on a local apacheserver. Since I’m used to not having NAT loopback on my network, I usually setup wordpress on the local dev-server and pass the blog URL as localhost:portnumber. When clients want to see progress, I upload to the www, and give them the link.
But I wanted the clients to be able to check out what I’m doing without uploading, so I had to find a way to enter the blog URL so it would work from outside too. If I put in localhost:portnumber, WordPress reroutes the visitor to that internal address which is not available from outside the LAN.
Enter DynDNS!
Dynamic DNS was the solution: So I entered myurl.dyndns.org:portnumber. It works like a charm, but since I’m inside a network without NAT-loopback, when I try to go to myurl.dyndns.org:portnumber, it won’t resolve for me. Another thing to solve.
Enter /etc/hosts!
If I modify my hosts file on my developer-machine, I can reroute all traffic to the dynamic dns URL, to the internal one, which is localhost:portnumber. So I added this to my /etc/hosts file:
//webdev locally on network without NAT-loopback
//10.0.0.2 is my dev-server
10.0.0.2 myurl.dyndns.org
Enter Terminal
To use these hosts-settings without a reboot, enter terminal on macosx and type
sudo dscacheutil -flushcache
So this is how I’ll do it going forward. Any tips and ideas can be put in the comments below.



