Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

localhost not working with ASP 1

Status
Not open for further replies.

hovercraft

Technical User
Jun 19, 2006
236
US
I'm really a newbie at server admin, so I'm a bit confused.

Once upon a time we hosted our own web/ftp site with the same name as our domain.
I switched the website/ftp and mail to a 3rd party and added a host record to forward to it.

I'm trying to install network timeclock software which uses ASP. It's trying to go to " and I get an error = "Cannot find server or DNS Error
Internet Explorer"

So I think it can't resolve to localhost. Could I need to add a "." record in DNS ? If so, how do I do this?

Any help would be greatly appreciated.
Thanks,
hovercraft
 
The localhost entry is located in your local "hosts" file not DNS. Make sure your local "hosts" file has an entry for localhost.

Also, try to use the localhost IP address to see if it works:


If that doesn't work either your problem may not be related to the host file issue above.

Good luck,
 
there isn't a host file called "localhost" and if I nslookup 127.0.0.1 it is our firewall, so that's probably the problem. Should I create a host file in a forward lookup zone to point "localhost" to the I.P. of one of our adapters or should it point to the firewall (which is a safe@office 225)

There are 2 forward lookup zones. One named 1234567.ourcompany.us and another named ourcompany.us
our website address is ourcompany.us can I completely get rid of that 2nd zone?

Sorry if this is basic stuff, I was thrown into this.
 
Oh, you said that it's NOT in DNS...Where would I find the "hosts" file?
 
localhost is set in the hosts file under system32\drivers\etc
it is pointing to the firewall 127.0.0.1
 
Yeah, the "hosts" file is located on each individual PC. You should have an entry that is like this

localhost 127.0.0.1

When you do an nslookup on 127.0.0.1 the name that is returned should be "localhost". Is it not coming back with "localhost"??? I'm a little confused by your statements. What was returned when you did an nslookup exactly?

Your DNS cache may also be corrupted. You can clear that cache with this command:

ipconfig /flushdns

Good luck,
 
That's correct the name returned is "my.firewall" which is our firewall.

Since we only have the 1 server which is our domain controller/dns/dhcp/file server I'll have to wait until after hours to try your suggestion of ipconfig /flushdns.

Thanks again!
Hovercraft
 
I just got home and realized that I had forgotten to flush the dns.

I did however disable one of the nic's and set the dns for the remaining as primary and our ISP's to 2nd and 3rd, after some great advice from a friend.

I'll have to wait until tomorrow to flush and test the localhost. But since the "hosts" file still points to the firewall, I think I'll still have the same problem.

Instead of setting localhost to 127.0.0.1 should I set it to the ip of the server?

Thanks,
Hovercraft
 
You're missing the point here. Several things to think about:

- Flushing the DNS cache on the system that sees 127.0.0.1 as "my.firewall" won't impact your production server and can be done any time of day or night.

- Make sure "my.firewall" doesn't have an entry in your DNS forward lookup zone with an IP of 127.0.0.1 ! This should point to your firewall's normal IP address.

- 127.0.0.1 needs to point to "localhost" in your HOSTS file on every PC and server! You should never point "localhost" to any other IP address. It will defeat the purpose of what a "localhost" is. If your HOSTS file is showing "my.firewall" with 127.0.0.1 as the IP address, you need to FIX this back to "localhost" on every machine this is the case.

If your firewall is using 127.0.0.1 as it's internal IP address, this is a huge problem that should be corrected! It's internal interface should have an assigned IP address in the same rang that your network uses (i.e. 192.168.x.x) but should not be using 127.0.0.1!
 
Oh and I forgot to add that 127.0.0.1 always refers to the device itself. In other words, "localhost" should always reference back to 127.0.0.1, and 127.0.0.1 always represents the machine you're on.

If you're on computerA, the 127.0.0.1 address is for computerA. If you're on computerB, 127.0.0.1 doesn't point back to computerA - it's for computerB. If your'e on computerC, 127.0.0.1 represents computerC and nothing else. So the 127.0.0.1 address is always relative to the device you are on at the time and it never refers to anything but that device you're on at the time. "localhost" is just the named version of 127.0.0.1 and it resides in the HOSTS file on every PC and server.

So, if you're on computerA and for some reason computerA thinks that 127.0.0.1 is "my.firewall" instead of "localhost" then you either have a problem in your HOSTS file on that machine, your DNS server in your domain (which should NEVER have an entry for 127.0.0.1) or your DNS cache is somehow corrupted on computerA, and can be cleared with the ipconfig /flushdns command.

So in your example in your first post above, let's assume that computerA is where you have your webserver and you type the following into your web browser ON computerA: Your computer is supposed to know that "localhost" is 127.0.0.1 and your computer knows that 127.0.0.1 is ALWAYS the computer you are on (and not some other remote computer). The address can not be used to access a webserver on say computerB from computerA because computerA is supposed to know that is itself. If your webserver is on computerA and you want to access it from computerB, the address you would have to type from computerB is - because is supposed to always be relative to the computer you are on at the time. Does that make sense?

Good luck and hope this is helping you understand.
 
In other words, will ONLY work if you're typing it from the web server itself. No other machines can use that address to access a web server that is sitting on another machine somewhere else in your domain.
 
Why don't you just use the machine name for the system the page is actually on? Seems to me you are making a mountain out of a mole hill.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Possibly. I wasn't sure if I was looking at a molehill or a mountain. However, after fixing the routing problems (I.E. getting rid of the irrelevant 2nd NIC) and setting DNS to point to the correct computer rather than the firewall...and subsequently turning off the software firewall, I can ping and nslookup correctly. Things are working smoothly.

Thanks for your suggestions lhuegele!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top