How to identify DNS server?

  • Thread starter Thread starter su haiqing
  • Start date Start date
S

su haiqing

Hi all,

How can I identify whether my local computer is a DNS server(using windows
API + vc 2005)?


Regards,
Su
 
su haiqing said:
How can I identify whether my local computer is a DNS server
(using windows API + vc 2005)?

It's not exactly what you asked, but calling GetNetworkParams() wll get you
the IP addresses of the DNS servers, and assuming that you know the IP
address of the local computer, you could do the compares.

Regards,
Will
www.ivrforbeginners.com
 
Thanks for your help. But if the program is running on the dns server then
we will get the top level DNS servers from GetNetworkParams(),and do
compares won't make right decision, am I right?
 
su haiqing said:
Thanks for your help. But if the program is running on the dns server then
we will get the top level DNS servers from GetNetworkParams(),and do
compares won't make right decision, am I right?

What I proposed won't tell you whether a particular machine can act as a DNS
server or not. It can only tell you if the IP address of a particular
machine is among those used for name resolution.

I suggest you repost in a group focusing on networking.

Regards,
Will
 
su haiqing said:
Hi all,

How can I identify whether my local computer is a DNS server(using windows
API + vc 2005)?

Send something to your own computer's port 53. UDP is used for most DNS
traffic, but DNS servers generally also listen on TCP port 53 in order to
support (authenticated) zone transfers.

API functions such as socket and connect will be helpful.
 
Back
Top