LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-01-2006, 11:14 PM   #1
mraray
Member
 
Registered: Sep 2005
Posts: 49

Rep: Reputation: 15
DNS headache


Hi EveryOne,

I have been looking around for dns lookup examples (blocking is fine) written in C.

I want to be able to look up records (ie mx) - so the gethostbyname functions are not suitable.

Can anyone point me to some simple examples? (I have been googling, but no luck)


Kind Regards,
Andrew.
 
Old 01-02-2006, 12:16 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
nslookup as example code?

Hi -

There's no "low-level DNS API" that I'm aware of.

A modest suggestion: try getting the source for "nslookup" and seeing how much of it is applicable to your project.

Another alternative is a Google search. Keywords might include "DNS resolver netdb ..."

'Hope that helps ..
 
Old 01-02-2006, 01:02 AM   #3
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
See resolver(3).

There are plenty of alternative DNS libraries out there:
http://www.chiark.greenend.org.uk/~ian/adns/
ftp://athena-dist.mit.edu/pub/ATHENA/ares/
http://cr.yp.to/djbdns.html

There's a mini-tutorial on the low-level aspects of DNS itself (not a tutorial on the resolver library):
http://hxdef.czweb.org/knowhow/coding-dns.txt
 
Old 01-03-2006, 03:27 AM   #4
mraray
Member
 
Registered: Sep 2005
Posts: 49

Original Poster
Rep: Reputation: 15
Thanks - All of those are handy.

Cheers,
Andrew
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DNS headache mdarby Slackware 1 11-04-2005 09:34 PM
Help im so new i have a headache jjh221 Linux - Newbie 3 02-11-2004 08:02 PM
Linux Becoming a Headache. croths Linux - Newbie 18 09-05-2003 01:48 PM
OpenOffice headache... wyvis Linux - Software 16 12-16-2002 12:23 PM
headache... katana Linux - General 2 08-02-2001 07:44 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration