0

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

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

3 Answers 3

1

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.

1

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.

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

My solution was to set up a DNS server.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .