LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-26-2004, 07:23 AM   #1
masood_gandhi
LQ Newbie
 
Registered: Oct 2004
Location: India
Distribution: Redhat 9
Posts: 8

Rep: Reputation: 0
how to create dns request packets


hi everybody,
i m working on project related to dns
and i m the new to this
can anyone pls tell me how to create
dns request packets and any related info
about it
i will appreciate your help
thanx
 
Old 10-26-2004, 07:48 AM   #2
n3tw0rk
Member
 
Registered: Sep 2003
Location: Rawalpindi, Pakistan
Distribution: Slackware
Posts: 86

Rep: Reputation: 15
You need to study the DNS protocol and learn how to do network programming. DNS uses the UDP (User Datagram Protocol) which means you would have to create a UDP socket and play with it .... there is a lot of information available on how to do network programming. Beej's guide is a good way to start, visit http://www.ecst.csuchico.edu/~beej/guide/net/ , for DNS visit http://www.freesoft.org/CIE/Topics/77.htm and also study the related RFCs.
 
Old 10-26-2004, 07:49 AM   #3
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
The "dig" command will create a DNS query/packet to a particular server. Example:

dig @xx.xx.xx.xx www.mydomain.com

Where xx.xx.xx.xx is the IP address of the DNS server.

If your are wanting to create a DNS query/packet in code, then take a look at:

man resolver
man gethostbyname
 
Old 10-26-2004, 09:41 AM   #4
masood_gandhi
LQ Newbie
 
Registered: Oct 2004
Location: India
Distribution: Redhat 9
Posts: 8

Original Poster
Rep: Reputation: 0
Thanx,
actually i have read DNS protocol but didnt know the exact packet formate of the request
 
Old 10-27-2004, 04:42 AM   #5
masood_gandhi
LQ Newbie
 
Registered: Oct 2004
Location: India
Distribution: Redhat 9
Posts: 8

Original Poster
Rep: Reputation: 0
Lightbulb want dig command information

hello everybody,
thanx for the earlier help but i want to know
what happens on dns server side when it recieves the request through dig command on client side.
 
Old 10-27-2004, 07:07 AM   #6
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
The DNS server would try to answer the query. If the answer to the query is already cached, then it would simply return the answer to the requesting system (dig). If the answer is not cached, then it would start a recursive query (starting at the root name servers) until it got the answer to be returned. FWIW: To visually see a recursive query, type: dig +trace www.mydomain.com

If you want to see the actual packets that are generated by dig or your DNS server, then use a program like tcpdump or ethereal.
 
  


Reply



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
Request: DNS Server List For Colorado fortezza Linux - Networking 2 04-10-2005 12:22 PM
How to create a DNS Server ? G_Slackw Linux - Networking 4 06-28-2004 10:28 PM
Can I create a local DNS? kuso Linux - Networking 3 09-22-2003 09:54 PM
[named/DNS] How do you create subdomains? BxBoy Linux - Networking 7 01-12-2003 09:37 PM
query DNS and create mysql database nabil Programming 0 01-18-2002 04:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:05 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