Windows 7 and DNS Server woes

Problem !

When I moved into my apartment this weekend I was unable to connect to the internet which lead to emotions of utter disbelief followed by despair and finally by obsessive compulsion and irritability until fixed. Despite the best intentions of my operating system to automatically diagnose and correct the problem it couldn’t. Not holding any grudges, we all have our limitations. I was stuck with –

Windows can’t communicate with the device or resource (Primary DNS Server).

Solution !

I knew something was wrong with MY machine because by husband’s Macbook-Pro worked just fine. Damn. So here’s the deal, Windows 7 on Sony VAIO had set my DNS server to a static value. To make things work, I simply had to ask windows to obtain DNS server address automatically. Easy-peasy.

1. Select Start
2. Select Control Panel
3. Select Network and Internet
4. Select Network and Sharing Center
5. Select Change adapter settings (in the left corner)
6. Right-Click Local Area Connection and select Properties
7. Select Internet Protocol Version 4 (TCP/IPv4) and click Properties
8. Under General select Obtain DNS server address automatically and click OK

When and why does this problem occur?

Technically I don’t know (Now I do, see update below!). But generally, the problem seems common on a Sony VAIO running Windows 7, especially if you switch between networks.

Is this solution permanent?

Apparently not! The behavior seems a bit erratic with the DNS server being reset to its static value randomly between standbys and resets. If that happens you can repeat the steps above or even try resetting the TCP/IP stack. With Windows, you never quite know the mood its in ;-)

[Update – an hour later] Understanding why this happens (technically) ! See below an as-is explanation by my friend Amit.

Step 0: The n/w is down
Step 1: You see some wlans
Step 2: You select one
Step 3: Your NIC ( n/w interface card) and the router get familiar, they authenticate
Step 4: Now the connection is established @ the “PHYSICAL LAYER”
Step 5: You now need IP to talk TCP & UDP, so send DHCP request
Step 6: Get response back from the router. It should contain among other things your MAC ( for verification), your new IP, your gateway address ( same as the router’s IP ) and DNS settings ( DNS server IP, search strings etc)

Thats it … your n/w should now be up. In your case, if the setting is disabled (Obtain DNS through DHCP) your machine will continue to use the static DNS that you have set and ignore the one given by your router.

Thanks Amit :) Life makes sense again!

Conclusion:If you want to enable DHCP on a Windows 7 machine, simply select “Obtain DNS server address automatically” in the TCP/IP settings as show above. Happy surfing!


20 thoughts on “Windows 7 and DNS Server woes

  1. I think this is the case where Windows was just trying to be a bit smart about caching your DNS server. It is one of the optimization techniques so that you dont spend valuable milliseconds fetching the dns server on every browser request. I believe it would have been more appropriate to defer this smartness to the browser, but there could be other requests to the internet other than browser (like curl in unix) which gives a reason for the OS to cache the DNS server. But I think the stupid thing was to not realize that the network has changed and flush the DNS cache. Windows, i tell ya!

  2. *Disclaimer: I don’t know what windows 7 does.

    The conclusion is not quite right.

    You enable DHCP and thus get your IP address,netmask and gateway from the router. Optionally you can enable obtaining DNS settings automatically (through DHCP).

  3. @Amit, why am I unable to see the difference in the two scenarios you present ? When you say enable dhcp what does that mean ? How will you get the settings ?? Will it not be thru dhcp? If so how is it different from the next case ?

    About the disclaimer, worry not .. Nobody knows what windows 7 does ;)

  4. I enjoy reading yur writings……alwayz !! find myself hooked to it….. :)

    no matter; it was beyond my understanding….:D

  5. Hello everybody,

    Thank you so much, I actually had the same problem and I thought I had solved it by selecting “Obtain DNS server address automatically”. However, after I downloaded some VAIO updates regarding the Vaio smart network system, it seems I have got a bigger problem.

    Each time I connect to the n/w the Vaio smart network authomatically shows the list of my profiles (home, office), and each time time it (growl) resets the DNS system as before. Meaning each time I need to go in the connection settings and select “Obtain DNS server address automatically”.

    Do you guys have any idea on how can I keep the authomatic option for good?

    Thanks so much for your time.

  6. I have the opposite problem. I live in an area where I do not want to use the automatic option. I want to set an alternate DNS server.

    Whenever I set the alternate DNS server, after a day or so it resets to automatic. Any idea how I can force my configuration so it doesn’t reset?

    Sony Vaio

  7. Hi All. Have been experiencing the same issue myself on my Vaio running Vista d:-( Not only does the machine revert to static DNS setting every time I switch it on, requiring me to change the TCPIP settings back to “automatically obtain DNS”, but if I then leave the machine for half an hour and it goes into powersave mode, guess what ….. no internet! Have to go back again into the TCPIP settings and reselect Obtain DNS automatically. This seems to be a big issue with Vaio’s looking around the web and resetting the stack did not help. Any other ideas, apart from live with it or throw Vaio out of top floor window??

  8. A work around would be to set the DNS Server addersses fro TCP/IP to fixed IP addressess such as the OpenDNS Servers.
    The addresses of the OpenDNS servers are for a primary DNS server and for a secondary server.

    This will work as long as you can get to these addresses via the gateway given to you by DHCP.

  9. Sorry I just discovered that seeting fixed DNS Server addresses only works for a little while on my Sony VAIO and then it goes back to the address previously set for my home network when that profile is reloaded, and setting obtain DNS Server address automaticaly doesn’t stay set either. Does anyone have a solution to this problem as yet as I am ready to through out my Sony VAIO.

  10. I’ve found the answer. At Least for Sony VAIO under Windows 7.
    1) Start Vaio Control Centre from the all programs menu.
    2) Select Network Connections
    3) Select Vaio Smart Network.
    4) Click on advanced
    5) Click on Settings (quickly before the Window disappears)
    6) Click on Profile Settings
    7) Select the profile you are using
    8) Click Edit
    9) Select IP and DNS
    10) Select Obtain DNS Server Automatically or specify OpenDNS addresses.
    11) Click Finsh
    and thats it.

  11. Hi Preeti, I just moved places too and had the same problem, thanks so much for posting this, very amusingly written too. I had some problems at my old place with that damn exclamation mark so I thought if I just wait it out maybe it would come right. Wishful thinking unfortunatly. I don’t get what any of it means really but I don’t really care.
    Thanks again,


  12. I just want to say “I love you!!!!” I couldn’t get my laptop to wifi with my new Clear modem. I was on the phone with a tech from Clear for almost 3 hours (3 different calls) and no luck. He was supposed to call me back yesterday but never did. I decided to Google around a bit and found you and TAH-DAH! Fixed in less than 2 minuets!!!! Thank you, thank you, thank you.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s