Click here to Skip to main content
12,819,248 members (31,609 online)
Click here to Skip to main content
Add your own
alternative version


18 bookmarked
Posted 28 Sep 2002

DNS if u need it

, 1 Oct 2002
Rate this:
Please Sign up or sign in to vote.
Simple quering DNS servers for retrieve information about host's DNS records
<!-- Download Links --> <!-- Add the rest of your HTML here -->


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
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.


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

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

You may also be interested in...


Comments and Discussions

GeneralBon! Pin
alexiworld16-May-04 2:48
memberalexiworld16-May-04 2:48 
QuestionWhy atre there so many compiler warnings? Pin
hesterloli8-Jan-04 18:33
memberhesterloli8-Jan-04 18:33 
AnswerRe: Why atre there so many compiler warnings? Pin
DarkSn0w9-Jan-04 0:51
memberDarkSn0w9-Jan-04 0:51 
GeneralRe: Why atre there so many compiler warnings? Pin
hesterloli9-Jan-04 5:53
memberhesterloli9-Jan-04 5:53 
GeneralRe: Why atre there so many compiler warnings? Pin
DarkSn0w10-Jan-04 6:09
memberDarkSn0w10-Jan-04 6:09 
GeneralGREAT CODE!!!!! Pin
BarçaBoy6-Nov-03 9:45
sussBarçaBoy6-Nov-03 9:45 
GeneralRe: GREAT CODE!!!!! Pin
DarkSn0w6-Nov-03 20:44
memberDarkSn0w6-Nov-03 20:44 
GeneralRe: GREAT CODE!!!!! Pin
Anonymous25-Dec-03 8:02
sussAnonymous25-Dec-03 8:02 
GeneralRe: GREAT CODE!!!!! Pin
DarkSn0w9-Jan-04 0:57
memberDarkSn0w9-Jan-04 0:57 
you may send query to any know DNS server. This may be DNS of your ISP or any ISP.Roll eyes | :rolleyes:
GeneralRe: GREAT CODE!!!!! Pin
d-code3-Dec-04 11:14
sussd-code3-Dec-04 11:14 
GeneralGREAT CODE!!!!! Pin
BarçaBoy6-Nov-03 9:45
memberBarçaBoy6-Nov-03 9:45 
Generalthanks Pin
njuhuangchinesemy6-Oct-03 23:02
membernjuhuangchinesemy6-Oct-03 23:02 
Generalgethostbyaddr Pin
mycia30-Mar-03 18:51
membermycia30-Mar-03 18:51 
GeneralRe: gethostbyaddr Pin
DarkSn0w22-Apr-03 4:34
memberDarkSn0w22-Apr-03 4:34 
GeneralThanx... Pin
EPulse22-Feb-03 2:12
memberEPulse22-Feb-03 2:12 
GeneralRe: Thanx... Pin
DarkSn0w22-Apr-03 4:29
memberDarkSn0w22-Apr-03 4:29 
GeneralDNSQuery() Pin
Andreas Saurwein6-Feb-03 7:07
memberAndreas Saurwein6-Feb-03 7:07 
GeneralRe: DNSQuery() Pin
DarkSn0w22-Apr-03 4:26
memberDarkSn0w22-Apr-03 4:26 
GeneralDon't use this source Pin
wukas6-Feb-03 6:41
memberwukas6-Feb-03 6:41 
GeneralRe: Don't use this source Pin
DarkSn0w22-Apr-03 4:25
memberDarkSn0w22-Apr-03 4:25 
GeneralRe: Don't use this source Pin
DarkSn0w6-Nov-03 20:37
memberDarkSn0w6-Nov-03 20:37 
GeneralRe: Don't use this source Pin
_BenC_22-Oct-04 2:35
member_BenC_22-Oct-04 2:35 
GeneralRe: Don't use this source Pin
TuPacMansur5-Sep-05 20:32
memberTuPacMansur5-Sep-05 20:32 
Questiongethostbyname() ?? Pin
Anonymous30-Sep-02 8:06
sussAnonymous30-Sep-02 8:06 
AnswerRe: gethostbyname() ?? Pin
DarkSn0w1-Oct-02 19:12
memberDarkSn0w1-Oct-02 19:12 
GeneralRe: gethostbyname() ?? Pin
Anonymous3-Oct-02 7:45
sussAnonymous3-Oct-02 7:45 
GeneralWin32 Pin
Shaun Wilde29-Sep-02 9:18
memberShaun Wilde29-Sep-02 9:18 
GeneralRe: Win32 Pin
DarkSn0w30-Sep-02 4:31
memberDarkSn0w30-Sep-02 4:31 
GeneralRe: Win32 Pin
Shaun Wilde30-Sep-02 5:02
memberShaun Wilde30-Sep-02 5:02 
GeneralAnd in English... Pin
Shaun Wilde29-Sep-02 8:54
memberShaun Wilde29-Sep-02 8:54 
GeneralRe: And in English... Pin
George29-Sep-02 16:36
memberGeorge29-Sep-02 16:36 
GeneralRe: And in English... Pin
Shaun Wilde29-Sep-02 23:59
memberShaun Wilde29-Sep-02 23:59 
GeneralRe: And in English... Pin
DarkSn0w30-Sep-02 4:28
memberDarkSn0w30-Sep-02 4:28 
GeneralRe: And in English... Pin
Shaun Wilde30-Sep-02 5:05
memberShaun Wilde30-Sep-02 5:05 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

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