I'm trying to set up a local subdomain and so far I've been partially successful. I've set up a local domain - gob.local - and I can access gob.local from both my server and from other computers on my network. I'm trying to set up coupon.gob.local but I've been less successful with that.

Here's what my /etc/hosts looks like:       gob gob.local coupon.gob.local localhost

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

I also have a VirtualHost set up for coupon.gob.local. If I go to coupon.gob.local in a browser on my server, it works just fine. If I go to the same URL on a different computer on my network it doesn't work. Again, gob.local works everywhere, so I don't understand what's different about coupon.gob.local that's making it not work.

Thanks, Jason

  • Have you updated the /etc/hosts on their machines too? – James L Sep 10 '10 at 15:30

That /etc/hosts file is going to be irrelevant to other computers on the network unless you're using that server as DNS for the network.

If you can navigate to gob.local on other computers on the network, and have it pull up the server in question, it's because they either have an entry in their hosts file, or they're using an internal DNS which has an entry for it. If that is the case, simply find that DNS and make an additional entry for coupon.gob.local.


The .local domain is special and resolved by mDNS, implemented by Avahi (specifically, the libnss-mdns package).

Since your hostname is gob, Avahi tells other machines on the same link that gob.local is your ip. That doesn't work for another random name.

You can ask avahi to publish coupon.gob.local by adding its link-local ip to /etc/avahi/hosts. is machine-local, but you can get a more public ip from getent hosts gob.local. The alternative is to set up a dns server. dnsmasq is one that scales down well.

  • Is this the kind of thing I would want to add to /etc/avahi/hosts? coupon.gob.local – Jason Swett Sep 13 '10 at 14:32
  • (replying for the record) yes. There is a default conffile with comments, and man avahi.hosts – Tobu Sep 24 '10 at 21:29

My solution was to set up a DNS server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.