Support has been available for mDNS and related discovery services on most Linux distros for sometime. Static IPs or fixed hostnames are not scalable for cloud/rapid deployment/Vagrant. Ideally, there is some good hackery in the cloud init tools and also possibly generating a unique hostname based on a string template on first boot (along with reseal scripts).
Anyhow, here's the easy way to get mDNS working for most major OSes.
On CentOS/RHEL/Fedora:
su - -c 'yum install -y avahi avahi-tools nss-mdns ;
service avahi-daemon start'
On Debian/Ubuntu: http://wiki.debian.org/ZeroConf
sudo su - -c 'apt-get install -y avahi-daemon avahi-discover nss-mdns ;
sudo invoke-rc.d avahi-daemon start'
On Arch: https://wiki.archlinux.org/index.php/Avahi
echo 'You won't need hand-holding here I assume.'
All:
What's nice is this gets mDNS working on the Linux box the other way too, so you can usually just start pinging/ssh/etc to your Mac right way. Woot. avahi-browse --all
is very neat.
Don't forget the inbound firewall rule on the box acting as a server.
-A INPUT -d 224.0.0.251/32 -p udp -m udp --dport 5353 -m comment --comment "mDNS" -j ACCEPT
Also, configure with /etc/avahi/ and restart the daemon.
Incidentially, I am building a CentOS 6.2 x86_64 minimal appliance for a client on my MacBook Pro under VMware Fusion 4.x.
Perhaps someone will add the bit for making sure that the announcement work and publishing of services (esp. ssh and web urls) works correctly for Mac, Linux and even Windows clients.
how do I configure avahi to automatically announce my server's hostname
. It's not actually a question about Apple Hardware or Software.OS X automatically broadcasts the computer name and associated address for link-local resolution and browsing, Avahi does (last I knew) only on a service-by-service basis. The details of which, however, are quite a bit over my head.
– VxJasonxV Dec 27 '11 at 12:31