Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

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 a server running at port 4433 on my localhost machine. I'd like to refer to the service as from the browser or any script that I write. How could I set the DNS on OSX to do this? Thanks!

share|improve this question

You could add a new line in your hosts file (see man hosts(5)). The easiest that I know of would be to open a Terminal and use nano to edit the file. You could type this in your terminal:

sudo nano /etc/hosts

(replace nano by vi if you are more familiar with the latter). Then go at the end of the file and add something like this:

Save the file (key combination for nano is (it's a o upper case): Ctrl + O).

The file hosts is read by mDNSResponder which is the local DNS cache on OS X (incl. Snow Leopard). So your browser will be redirected to the IP you set in the file.

share|improve this answer

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.