Click here to Skip to main content
15,884,388 members
Articles / Desktop Programming / MFC
Article

DNS if u need it

Rate me:
Please Sign up or sign in to vote.
4.11/5 (9 votes)
1 Oct 2002 109.4K   1.9K   20   34
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.

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


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

Comments and Discussions

 
GeneralGREAT CODE!!!!! Pin
BarçaBoy6-Nov-03 8:45
BarçaBoy6-Nov-03 8:45 
Generalthanks Pin
nju6-Oct-03 22:02
professionalnju6-Oct-03 22:02 
Generalgethostbyaddr Pin
mycia30-Mar-03 17:51
mycia30-Mar-03 17:51 
GeneralRe: gethostbyaddr Pin
DarkSn0w22-Apr-03 3:34
DarkSn0w22-Apr-03 3:34 
GeneralThanx... Pin
EPulse22-Feb-03 1:12
EPulse22-Feb-03 1:12 
GeneralRe: Thanx... Pin
DarkSn0w22-Apr-03 3:29
DarkSn0w22-Apr-03 3:29 
GeneralDNSQuery() Pin
Andreas Saurwein6-Feb-03 6:07
Andreas Saurwein6-Feb-03 6:07 
GeneralRe: DNSQuery() Pin
DarkSn0w22-Apr-03 3:26
DarkSn0w22-Apr-03 3:26 
GeneralDon't use this source Pin
Andrius Mudinas6-Feb-03 5:41
Andrius Mudinas6-Feb-03 5:41 
GeneralRe: Don't use this source Pin
DarkSn0w22-Apr-03 3:25
DarkSn0w22-Apr-03 3:25 
GeneralRe: Don't use this source Pin
DarkSn0w6-Nov-03 19:37
DarkSn0w6-Nov-03 19:37 
GeneralRe: Don't use this source Pin
_BenC_22-Oct-04 1:35
_BenC_22-Oct-04 1:35 
GeneralRe: Don't use this source Pin
TuPacMansur5-Sep-05 19:32
TuPacMansur5-Sep-05 19:32 
Questiongethostbyname() ?? Pin
Anonymous30-Sep-02 7:06
Anonymous30-Sep-02 7:06 
AnswerRe: gethostbyname() ?? Pin
DarkSn0w1-Oct-02 18:12
DarkSn0w1-Oct-02 18:12 
GeneralRe: gethostbyname() ?? Pin
Anonymous3-Oct-02 6:45
Anonymous3-Oct-02 6:45 
GeneralWin32 Pin
Shaun Wilde29-Sep-02 8:18
Shaun Wilde29-Sep-02 8:18 
GeneralRe: Win32 Pin
DarkSn0w30-Sep-02 3:31
DarkSn0w30-Sep-02 3:31 
GeneralRe: Win32 Pin
Shaun Wilde30-Sep-02 4:02
Shaun Wilde30-Sep-02 4:02 
GeneralAnd in English... Pin
Shaun Wilde29-Sep-02 7:54
Shaun Wilde29-Sep-02 7:54 
GeneralRe: And in English... Pin
George29-Sep-02 15:36
George29-Sep-02 15:36 
GeneralRe: And in English... Pin
Shaun Wilde29-Sep-02 22:59
Shaun Wilde29-Sep-02 22:59 
GeneralRe: And in English... Pin
DarkSn0w30-Sep-02 3:28
DarkSn0w30-Sep-02 3:28 
GeneralRe: And in English... Pin
Shaun Wilde30-Sep-02 4:05
Shaun Wilde30-Sep-02 4: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.