Category: Networking

Flushing DNS Lookups

Every now and then I run into a situation where I need to clear my DNS cache. This is sometimes needed when there are negative DNS values, meaning incorrect IP addresses on my computer for certain internet sites that I want to connect to. You can use the following commands to flush DNS and see if this allows you to reach the site.

Mac OS X:

For OS X, Lookupd takes care of cached DNS entries. You will need to open a Terminal session and type the following command:

lookupd -flushcache

On Mac OS X 10.5 Leopard, you no longer have the lookupd command. Use the dscacheutil command instead:

dscacheutil -flushcache

Windows:

For Windows, the IPConfig utility serves as an easy way to view TCP/IP settings and as a utility to flush DNS. You will need to open up a prompt and type the following command:

ipconfig /flushdns

Windows2000 & XP save negative DNS entries by default, so you might want to try disabling negative DNS caching to get a more responsive internet connection.

Microsoft has some notes on DNS settings in Windows too that you can reference.

Filed under: NetworkingTagged with: , , , , , , , , , , , , , ,

DSL Router & Forwarding Ports Problem

If you read my previous post on Troubleshooting Ports on DSL, then perhaps you will get the whole idea on how to forward ports, but as I discovered, powering off your routers may cause packet loss afterwards.

In a typical DSL setup your main DSL modem provide DHCP services, and although there is only one physical ethernet port that it connects to, unless you specifically setup the DSL modem to forward all traffic to your LAN router, chances are a reset could send packets to another ip address and all of a sudden your packets get lost going to a different ip.

To work around this, you either have to be careful about how you reset your routers or force the DSL modem to route everything to one IP address, therefore losing some of the firewall protection that the DSL modem is providing.

Here is a proper way to reset your home network and routers.

1. Turn off everything. This includes computers, routers, DSL modem.

2. Power on the DSL Modem first. Wait a few minutes until the LAN and WAN lights turn solid, usually green.

3. Power on your home router, the Linksys, Netgear, D-Link, or whatever brand you have.

4. After a couple of minutes, turn on the computers and other devices on your network.

5. Verify the NAT on the DSL modem is still setup properly and that the home router is connecting to the DSL modem with the correct IP address.

For the Cisco 678 ADSL modem, telnet into it and type:

show nat

The last lines that come up will show the last packets that were sent and what local ip they were sent to. It should be 10.0.0.2 for the 678, unless you changed it.

Filed under: NetworkingTagged with: , , , , , , , ,

Fixing DNS Timeouts on Windows2003

Recently I decided to upgrade my DSL broadband connection from Qwest. The upgrade would give me twice the download bandwidth of before and so I thought it was a great idea. However, I started having a lot of problems soon after the connection was upgraded. Most annoying were the web browser issues, where certain sites would come up as being unreachable or timing out due to no response. Most of the time I would just hit refresh and the web site would come up. The DSL connection feeds a small LAN network and so it was not just one computer, but all of them that were having this problem.

This problem is really the result of packet loss or DNS reponse, or as many techs call it DNS timeouts. On a slower connection, you might never experience this issue, but as your connection increases in speed, lag times from certain servers does become more apparant, and you can not assume that because your internet connection just quadrupled in speed, that the servers that you are communicating with will suddenly give your requests more responsive attention. It just does not work that way.

My LAN runs a Window2003 Server with DNS, so I started with this first. All the other computers point to Windows Server as their primary DNS Server. After making sure that DNS was running properly on the server, and that it too was having the same problem, I researched it and found this Microsoft Technote:

Some DNS Name Queries Are Unsuccessful After You Upgrade Your DNS Server to Windows Server 2003

It appears that Windows2003 supports extended DNS information, and that some routers are not letting these UDP packets through because they are larger than usual.

This issue occurs because of the Extension Mechanisms for DNS (EDNS0) functionality that is supported in Windows Server 2003 DNS.

ENDS0 permits the use of larger User Datagram Protocol (UDP) packet sizes. However, some firewall programs may not permit UDP packets that are larger than 512 bytes. As a result, these DNS packets may be blocked by the firewall.

The easy fix is of course to turn off ENDS0.

1. Install the Dnscmd.exe program from the Windows Server 2003 Support Tools. To install the Windows Support Tools, right-click Suptools.msi in the Support\Tools folder on the Windows Server 2003 CD-ROM, and then click Install. Follow the steps in the Windows Support Tools Setup Wizard to complete the installation of the Windows Support Tools.

2. At a command prompt, type the following command, and then press ENTER:

dnscmd /config /enableednsprobes 0

This did help the problem some, but did not make it go away completely, and chances are that if you just have one computer with broadband and you are having the same problem, then you need to start looking at something called the MTU setting.

DSL Reports has more detailed information on MTU settings, but the short story is that MTU is the maximum size packet you can send through your broadband connection to your ISP, without your router splitting it up. Think of it as the maximum occupancy of your connection. The most it can carry at once.

A simple test to find out what your highest MTU setting can be is to open a DOS Prompt and type:

ping -f -l 1472 www.webkeydesign.com

You can ping any server or website you want, but do not ping a site like Google, because Google has multiple servers, and you will end up pinging different ones possibly and get inaccurate results. Pick a specific IP or a site you know only has one server.

If you get the message: packet need to be fragmented, then you need to decrease the number 1472 by 1, until you no longer get that message. If you did not get that message, then you can try adding 1, until you get the highest value that does not fragment. Once you have that number, then just add 28 to that number and that is your MTU. Most setups will work with 1492.

If you are using Mac OS X, you can try using the Network Utility in the Utilities Folder, or just try the 1492 setting for starters.

Now comes the configuration part, you have to change the MTU in all your computers and in all of your routers (broadband modem and wireless router if you have a second router). Most likely your router is defaulting to 1500, so you will definitely need to change that. The MTU setting is network card specific, so you will need to make changes for each network adaptor.

Once you made the changes, the DNS Timeouts should be gone. If they are not then check with your ISP to make sure that you have the right DNS Server addresses. As a general rule with wireless routers or small home office routers, you should type in the DNS addresses into each computer, and not depend on the router for your DNS server. Most small routers have a hard time with serving as primary DNS, so it works out better to just type in the ISP DNS addresses into each computer. If you are running DNS locally with a Windows Server or Linux Server, then you usually can just use the local server as the primary DNS, and type in the ISP addresses as backups.

Additional Info:

How To Find MAX MTU?

Filed under: Networking