Click here to Skip to main content
Click here to Skip to main content

DNS if u need it

By , 1 Oct 2002
 

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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

DarkSn0w
Web Developer
Russian Federation Russian Federation
Member
Programmer with 5 year of work
like networking applications and fun codes

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralBon!memberalexiworld16 May '04 - 1:48 
QuestionWhy atre there so many compiler warnings?memberhesterloli8 Jan '04 - 17:33 
AnswerRe: Why atre there so many compiler warnings?memberDarkSn0w8 Jan '04 - 23:51 
GeneralRe: Why atre there so many compiler warnings?memberhesterloli9 Jan '04 - 4:53 
GeneralRe: Why atre there so many compiler warnings?memberDarkSn0w10 Jan '04 - 5:09 
GeneralGREAT CODE!!!!!sussBarçaBoy6 Nov '03 - 8:45 
GeneralRe: GREAT CODE!!!!!memberDarkSn0w6 Nov '03 - 19:44 
GeneralRe: GREAT CODE!!!!!sussAnonymous25 Dec '03 - 7:02 
GeneralRe: GREAT CODE!!!!!memberDarkSn0w8 Jan '04 - 23:57 
GeneralRe: GREAT CODE!!!!!sussd-code3 Dec '04 - 10:14 
GeneralGREAT CODE!!!!!memberBarçaBoy6 Nov '03 - 8:45 
Generalthanksmembernjuhuangchinesemy6 Oct '03 - 22:02 
Generalgethostbyaddrmembermycia30 Mar '03 - 17:51 
GeneralRe: gethostbyaddrmemberDarkSn0w22 Apr '03 - 3:34 
OK. this code is thread safe, what do you tell about Terminate function? where do you will user this?
In this code wery easy make terminate fuction, look at line witch WaitForSingleObject() function in query() function and you can make in this anything. Smile | :)
GeneralThanx...memberEPulse22 Feb '03 - 1:12 
GeneralRe: Thanx...memberDarkSn0w22 Apr '03 - 3:29 
GeneralDNSQuery()memberAndreas Saurwein6 Feb '03 - 6:07 
GeneralRe: DNSQuery()memberDarkSn0w22 Apr '03 - 3:26 
GeneralDon't use this sourcememberwukas6 Feb '03 - 5:41 
GeneralRe: Don't use this sourcememberDarkSn0w22 Apr '03 - 3:25 
GeneralRe: Don't use this sourcememberDarkSn0w6 Nov '03 - 19:37 
GeneralRe: Don't use this sourcemember_BenC_22 Oct '04 - 1:35 
GeneralRe: Don't use this sourcememberTuPacMansur5 Sep '05 - 19:32 
Questiongethostbyname() ??sussAnonymous30 Sep '02 - 7:06 
AnswerRe: gethostbyname() ??memberDarkSn0w1 Oct '02 - 18:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 2 Oct 2002
Article Copyright 2002 by DarkSn0w
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid