Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have created a simple server in my office LAN. The server can be reached from outside the network: I have configured NAT on pppoe interface to route correctly the packets into the correct local IP.

The problem is that inside the network I have to use a local address (192.168.1.X), (NAT from inside the network does not work) and remember to use the remote address ( when I'm outside the network.

I'd like to always use my domain name to reach the server, the server will have a lot of services and I don't want to have duplicated alias for each one.

I'm a Mac developer and I need to use Jenkins for some compilations jobs, for this reason both the server and my working environment runs on Mac OS X 10.8.

share|improve this question
up vote 3 down vote accepted

You need to set up an internal DNS server that replies for that domain in your LAN. You can set up BIND to do that, or any number of other programs will do the same thing. When you're in the LAN, set up DHCP to give you the internal DNS server as a primary.

Here is some info about setting up the DNS server in OSX server.

share|improve this answer
I have implemented this solution and it works like a charm. – Giuseppe Mar 25 '13 at 16:51
Glad to hear it! – NickW Mar 25 '13 at 17:04

If you don't have an internal dns server on your private network you can edit the host file on your mac:

sudo vi /etc/hosts

replace the ip below with your webserver ip

Or if you router provides dns you could add a static hostname there.

Here are the instructions for linksys routers as an example

share|improve this answer
If he has a laptop, and takes it with him to clients? – NickW Mar 25 '13 at 16:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.