For testing purposes, you can ‘fake’ various domain names to point at
your local server. The domains can be real or fake domain names, and
all should be pointed at the “localhost” ip address (127.0.0.1).
On *nix & Mac OS X, edit the /etc/hosts file. E.g.:
On Mac OS X, there are a couple extra steps. First, in the terminal,
run the command:
sudo niload -v hosts . < /etc/hosts
That will copy the hosts into NetInfo.
You probably also need to add the hosts as ‘machines’ in NetInfo,
too. For each host:
sudo niutil -create / /machines/my.example.tld
sudo niutil -createprop / /machines/my.example.tld ip_address
With that, you’ll be able to access a server running on your system
with any of the domain names you used.
Note that doing the above prevents you from accessing the actual
servers at those domains if they are real domains on other computers.
So, don’t forget to roll that stuff back later!
To roll back:
Delete or comment-out the domains you added in the /etc/hosts file.
On Mac OS X, you can use the NetInfo Manager application
(/Applications/Utilities/NetInfo Manager) to delete the appropriate
entries from the “machines” directory. (Be sure to not mess with the
“localhost” entry, though.)