65.9K
CodeProject is changing. Read more.
Home

DNS if u need it

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.11/5 (9 votes)

Sep 29, 2002

viewsIcon

113064

downloadIcon

1927

Simple quering DNS servers for retrieve information about host's DNS records

Introduction

Some times you want to receive information from DNS servers using C++. This simple project shows how you can send and receive messages to and from DNS servers.

There are 2 downloads supplied (see above)
The first download contains the DNS structures and CDnsResolver class that you can use to make queries of your own.
The second download contains a sample project, console application.
Use sample app:
usingdns.exe DNS server mail_host mail_host [any count hosts]

For advanced users I'm add new demo project dgramm.zip
This showing as interpret DNS answers (gethostbyname() too ;)

This cool for Mail servers or just for study how it works.

For more inforamtion read the RFC documentation at DNS.NET [^] which also contains a number of useful tools.

If you know how to return this information under plain Win32 please post a message below.