How can I find the current DNS server?

Question :

How can I find the current DNS server?,

Answer :

I’m using Delphi and need to get the current Windows DNS server IP address so I can do a lookup. What function should I call to find it? The only solution I have right now does an ipconfig/all to get it, which is horrible.


Found a nice one using the function GetNetworkParams().Seems to work quite good.
You can find it here:

That’s the answer How can I find the current DNS server?, Hope this helps those looking for an answer. Then we suggest to do a search for the next question and find the answer only on our site.

Read More  Text Editor For Linux (Besides Vi)? [closed]

Disclaimer :

The answers provided above are only to be used to guide the learning process. The questions above are open-ended questions, meaning that many answers are not fixed as above. I hope this article can be useful, Thank you