You can't connect to web sites because of DNS issues.
Sometimes when you can't connect to a web site, the cause is a DNS problem. While there is no single way to fix the problem, here are steps you should take.
First, find out whether the issue is with the web site itself, not with DNS. To find out if a web site is live, issue the ping command at the command prompt or Run box, like this:
If the site is live, you'll get an answer like this:
Pinging www.zdnet.com [188.8.131.52] with 32 bytes of data: Reply from 184.108.40.206: bytes=32 time=119ms TTL=242 Reply from 220.127.116.11: bytes=32 time=79ms TTL=242 Reply from 18.104.22.168: bytes=32 time=80ms TTL=242 Reply from 22.214.171.124: bytes=32 time=101ms TTL=242 Ping statistics for 126.96.36.199: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 79ms, Maximum = 119ms, Average = 94ms
If it's not, you'll get a response like this:
Ping request could not find host. Please check the name and try again.
If you ping a site and it's live, but you can't connect to it with your browser, a DNS problem might be the reason. If you suspect you're having a DNS problem, take the following actions.
Check your HOSTS file
If your HOSTS file contains an incorrect or outdated listing, you won't be able to connect. Even if you don't recall adding listings to a HOSTS file, it still may contain listings, because some Internet accelerator utilities edit them without telling you. Open your HOSTS file with Notepad and see if the site you can't connect to is listed there. If it is, delete the entry, and you should be able to connect. For more details, see Recipe 13.1, "Using a HOSTS File to Speed Up Web Access."
Check your DNS settings
Make sure your DNS settings are correct for your ISP or network and use them on your system. To do it:
The problem may be related to your DNS cache. Your PC keeps a cache of DNS information about recent sites you've visited. When you type in a URL to visit, your PC first checks this cache before going out to a DNS server, and if it finds the entry in the cache, it uses that entry. So if your DNS cache has outdated information, you won't be able to connect to the web site. The best solution is to flush the DNS cache. Do it by typing ipconfig /flushdns at a command prompt.
If you know the address of DNS servers, ping them. If you can't reach them, the problem may be with your router, or with your DSL or cable modem.
Find out if your ISP is having DNS problems
The problem may be caused by your ISP perhaps its DNS servers are down. Ping each of your ISP's DNS servers and, if any of them don't respond, remove them from your DNS list, as outlined earlier in this recipe.
Adjust XP's DNS cache settings
The problem may be caused by your DNS cache settings. As a way of speeding up DNS, when you visit a site, XP puts the DNS information into a local DNS cache on your PC. So, when you want to go to a site, XP first looks in its local DNS cache, called the resolve cache, to see whether the DNS information is contained there. That way, if it finds the information locally, it doesn't have to query a remote DNS server to find IP information. The cache is made up of recently queried names and entries taken from your HOSTS file.
The cache contains both negative and positive entries. Positive entries are those in which the DNS lookup succeeded, and you were able to connect to the web site. When XP looks in the cache, if it finds a positive entry, it immediately uses that DNS information and sends you to the requested web site.
Negative entries are those in which no match was found, and you end up getting a "Cannot find server or DNS Error" in your browser. Similarly, when XP looks in the cache and finds a negative entry, it gives you the error message without bothering to go out to the site.
Negative entries can lead to problems. When you try to make a connection to a site that has a negative entry in your cache, you'll get an error message, even if the site's problems have been resolved and it's now reachable.
You can solve this problem, though, by changing a Registry setting. By default, XP caches negative entries for five minutes. After five minutes, they're cleared from your cache. But if you'd like, you can force XP not to cache these negative entries, so that you'll never run into this problem. To do it:
You can also use the Registry to control the amount of time that positive entries are kept in the DNS cache. By default, they are kept for 24 hours. To change the default, go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters again and create a DWORD value called MaxCacheEntryTtlLimit. (If it's already present, just edit the value.) For the value, enter the amount of time you want the entry to remain, in seconds, making sure to use decimal as the base.
Also, you can sometimes fix DNS cache problems without having to edit the Registry. First try flushing the DNS cache by issuing the command ipconfig /flushdns at a command prompt. That often solves the problem, and you won't have to resort to Registry editing.
The http://www.seoconsultants.com/tools/dns.asp site provides a variety of DNS troubleshooting tips. It can also generate a DNS report for a domain and detail any DNS problems it finds.