PDA

View Full Version : Personal Webserver - IP resolve


gsprague
07-19-2005, 07:10 AM
Hello,

Often the Personal Web Server will resolve my IP address (http://11.1.111.111) as http://myName.local (myName is the machine name). This works fine on my local machine, and possibly even on other macs, but Windows doesnít recognize it, so often when I send someone a URL on my local machine to look at, the web app isnít usable because the IP address gets resolved to the unusable machine name dot local instead.

How can I keep that from happening? I want it to stay as the IP and not resolve.

It only seems to happen when I point at a directory, not a file, and the directory name has no trailing slash.
For example, http://11.1.111.111/projects/myPage resolves as http://myName.local/projects/myPage
whereas http://11.1.111.111/projects/myPage/index.php or http://11.1.111.111/projects/myPage/ will keep the IP address.

Thanks,
Galen

ShavenYak
07-19-2005, 07:22 AM
Obvious solution would be not to point at a directory without using the trailing slash. If you forget and do it anyway, cut and paste your numeric IP into the link before you send it.

Incidentally, the .local name should work for any machine on your local subnet which uses Bonjour/Rendezvous/ZeroConf for name resolution. It won't work for anyone on the other side of your router, whether they are Mac, Windows, or other.

You might consider getting yourself a real domain name and pointing it to your Mac with a Dynamic DNS service, like dyndns.org - then you can give people a nicer URL, and not have to worry if your IP address changes.

LoonyPandora
07-19-2005, 07:30 AM
I would edit your /etc/httpd/httpd.conf file with something like TextWrangler (http://www.barebones.com/products/textwrangler/index.shtml) - look through that file for something like the following:


# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
# machine always knows itself by this address. If you use Apache strictly for
# local testing and development, you may use 127.0.0.1 as the server name.
#
#ServerName new.host.name


Uncomment the ServerName section, and change it to be the name you want to use. Using your example above:


# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
# machine always knows itself by this address. If you use Apache strictly for
# local testing and development, you may use 127.0.0.1 as the server name.
#
ServerName 11.1.111.111


Of course, make a backup of the file before editing anything.

Once you've edited that, restart personal websharing, et voila, it should be OK :)

voldenuit
07-19-2005, 07:34 AM
Perhaps the owner of the netblock you use are just unhappy, after all its theirs for more than ten years:

011/8 May 93 DoD Intel Information Systems

;)

It looks like nobody announces them these days, but you should use RFC 1918 space for tinkering anyway.

The subject came up some time ago, an intelligent search might find it, I don't remember the conclusion.