Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Where is the Windows version of the Linux file resolv.conf?

I'm currently trying to do a reverse DNS lookup on all ips in the local subnet. My code takes in resolv.conf on Linux to do the reverse lookup but I need to make the script cross platform compatible so I'm trying to find the Windows equivalent.

I've checked the etc directory that hosts resides in and the information on Google seems to say that Windows doesn't exactly use a file to point to the nameserver? If so, how do I get the IP of the local nameserver (eg. or

share|improve this question

closed as off topic by mfinni, mailq, Wesley, John Gardeniers, Shane Madden Sep 20 '11 at 3:16

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Indeed, nameserver info is not stored in a file. What is your script written in? – squillman Sep 19 '11 at 20:37
It's written in python. How should I get the ip of the nameserver in python then? – Emsu Sep 19 '11 at 20:39
You're asking how to get host info via Python. Off to SO you go. – mfinni Sep 19 '11 at 20:52
up vote 1 down vote accepted

There is no file for it. Use ipconfig /all to see your configured nameservers.

share|improve this answer
In python, is there a better way than calling ipconfig/all and parsing the results? – Emsu Sep 19 '11 at 20:42
@Emsu How should I know? Isn't there a help on Python? – mailq Sep 19 '11 at 20:43
Yeah, I was just wondering if you might know. Thanks for your help :) – Emsu Sep 19 '11 at 20:46
@Emsu Google knows everything:… – mailq Sep 19 '11 at 20:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.