Server Fault is a question and answer site for system and network administrators. 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

Is it possible to have more than one ".local" address per machine using Bonjour on OSX? I would like to add x.local and archive.x.local so that I can run multiple apache vhosts.

System Preferences > Sharing > Computer Name only allows me to have one currently.

share|improve this question

There is no GUI in OS X to have more than one .local hostname for a machine.

However, you can register programmatically any number of name and service combinations in the mDNS .local domain.

If you're looking to do this from a script (or on a temporary basis, manually), there is a command-line utility dns-sd, which you can use to register services. ( man dns-sd for the man page).

To register a web server, you'll want to use something like: dns-sd -R _http._tcp local so: dns-sd -R myserver _http._tcp local 8080

The service will remain registered as long as the command is active, so you will need to run it in the background to keep it running (add the & to the end to background the task).

The documentation explicitly states it can only register in the .local domain, so you likely won't be able to do archive.x.local, but you should be able to do archive-x.local.

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.