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'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:

127.0.0.1       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

share|improve this question
    
Have you updated the /etc/hosts on their machines too? –  James Lawrie Sep 10 '10 at 15:30

3 Answers 3

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.

share|improve this answer

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. 127.0.0.1 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.

share|improve this answer
    
Is this the kind of thing I would want to add to /etc/avahi/hosts? 192.168.140.25 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
up vote 0 down vote accepted

My solution was to set up a DNS server.

share|improve this answer

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.