Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want to broadcast multiple host names on a local network only from a single instance of Ubuntu Server 10 with Zeroconf or something similar. It has to be zeroconf or similar because it's going to be used in a virtual machine configuration and will be copied around so I can't depend on an external DNS server. I've collected a number of resources, but haven't been able to figure it out. Is there a way to do this?

Here are some resources I've gathered: http://bit.ly/l5W4ab

EDIT: It would also be fine to set up VirtualBox to be a DNS server too.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You can configure Avahi to publish arbitrary hostnames using /etc/avahi/hosts, but you need to specify the exact IP address to map the hostname to. There doesn't seem to be a way to publish multiple hostnames to the IP addresses detected by Avahi. You could write a startup script which populates /etc/avahi/hosts after discovering the VM's IP address.

share|improve this answer
    
I ended up solving this problem an entirely different way, but I am tempted to come back to this problem and try this solution. It sounds promising. –  Jonathan Swinney Apr 20 '12 at 14:34

Why not just set up your ubuntu server to be a dns and dhcp server and not worry about zeroconf? First, configure the dhcp server to give out addresses in some range sufficient for your needs. Then, set up a forwarding nameserver on the machine. These instructions are pretty similar to what you want to do. Basically you are allowing the dhcp server to change your dns server on the fly. Then when the other virtual machines on the network come up, they send their preconfigured names to the dhcp server. The dhcp server in turn sets those names in dns for your local domain.

Another very simple option is to set up something like DNSmasq. DNSmasq can read the server's /etc/hosts file and serve those entries up via dns to other machines on your network. So in this scenario you would maintain a big hosts file on the server of all the VM names, and the machine would again automatically serve those names over dns. You would still want to use dhcp in this case so the VMs could get addresses on your network automatically, but this is a simpler approach than configuring BIND for dns.

My suspicion is that dhcp + dnsmasq will probably work for you, unless you are attempting to run massive numbers of VMs.

share|improve this answer
    
The ubuntu server itself is the virtual machine. It needs to broadcast its own names without the help of an external DNS server. I need this to work for my coworkers in coffee shops, etc. Put the vm into host-only or shared (nat) mode and the vm should broadcast names itself. I just had another thought... if I could make virtual box (or vmware) be the local DNS server, that should work. –  Jonathan Swinney May 11 '11 at 13:11

Your Answer

 
discard

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.