My basic question is not "why doesn't this work?", but "why DOES this work?".
I have a computer running apache 2.2 under windows, with the ServerName set to something like gateway_01. It's connected to the office wifi, on a netgear router. I set it up naively, without configuring anything else, and it seemed to work.
But it doesn't work consistently. As far as I can tell from googling, to be sure that I can access it using http://gateway_01
over the local network, I need to:
- Give it a static IP address
- Run a local DNS server that knows that
http://gateway_01
corresponds to 192.168.1.whatever (or modify the hosts file on my computer, but it wouldn't be feasible to do that for every computer on the network, including random guests and people's phones). - Set my router to use the local DNS server when computers connect via DHCP
I haven't actually done any of that. Sometimes I can reach gateway_01 perfectly fine, and sometimes I need to use the IP address.
Why is this, and can I set things up to work reliably without having to run a local DNS server? I have a sneaking suspicion it's something to do with windows, workgroups and the fact that the computer's name is the same as the ServerName, but I'd quite like to know for sure what's actually going on.
_
in your computer names. That isn't a permitted character in DNS records. Or at least it isn't permitted in the type of records you need to make a server web visible on the Internets. See: en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names