LinuxQuestions.org
Visit Jeremy's Blog.
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 11-06-2004, 07:08 AM   #1
codedv
Member
 
Registered: Nov 2003
Location: Slough, UK
Distribution: Debian
Posts: 146

Rep: Reputation: 15
DNS Dialog??


If I were to open a connection on port 53 to a name server. What commands would I send to it to resolve host names?
 
Old 11-06-2004, 07:54 AM   #2
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
DNS queries are UDP based, so opening up port 53 (like with telnet) will not work. If you are asking about quering a DNS server in code, then take a look at: man resolver
 
Old 11-06-2004, 08:03 AM   #3
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Re: DNS Dialog??

Quote:
Originally posted by codedv
If I were to open a connection on port 53 to a name server.
you can't really open a "connection" as the UDP protocol is connectionless...

Quote:
What commands would I send to it to resolve host names?
look at "man resolver" as suggested by scowles, or you can also use a packet sniffer when making a dns query...


Quote:
Originally posted by scowles
DNS queries are UDP based, so opening up port 53 (like with telnet) will not work.
what do you mean with this?? telnet listens on port 23/tcp and hence uses connections...

dns servers listen on port 53/udp... the port needs to be open and accessible for them to work...


Last edited by win32sux; 11-06-2004 at 08:05 AM.
 
Old 11-06-2004, 10:15 AM   #4
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
Quote:
--------------------------------------------------------------------------------
Originally posted by scowles
DNS queries are UDP based, so opening up port 53 (like with telnet) will not work.
--------------------------------------------------------------------------------

what do you mean with this?? telnet listens on port 23/tcp and hence uses connections...

dns servers listen on port 53/udp... the port needs to be open and accessible for them to work...
Sorry for the confusion. I did not really understand what the OP was asking (command line or code), so I was referring to using "telnet dns_server 53", which will not work since DNS queries are UDP based.
 
Old 11-06-2004, 04:03 PM   #5
codedv
Member
 
Registered: Nov 2003
Location: Slough, UK
Distribution: Debian
Posts: 146

Original Poster
Rep: Reputation: 15
OK - so it uses UDP and UDP is a conectionless protocol. But how does that work, you send something to the DNS server and it sends a response, but there is no connection. So how does the program querying the DNS server know where to look for it?

I used telnet as an example, but as it only does TCP connections thats a bit useless. If I were to use socket proramming in C for example. Surely the commands you send to the DNS server are documented somewhere, I can't seem to find them anywhere though.
 
Old 11-06-2004, 05:16 PM   #6
scowles
Member
 
Registered: Sep 2004
Location: Texas, USA
Distribution: Fedora
Posts: 620

Rep: Reputation: 31
See: man resolver
See: man gethostbyname
 
Old 11-06-2004, 07:27 PM   #7
RHELL
Member
 
Registered: Feb 2004
Location: Outermost mingetty
Distribution: RHEL3,RH4U4,Sol9, Sol10
Posts: 321

Rep: Reputation: 31
This might be more of a developers forum question, but try these out:

http://www.protocols.com/pbook/tcpip7.htm
http://www.cis.ohio-state.edu/htbin/rfc/rfc1035.html
http://www.cis.ohio-state.edu/htbin/rfc/rfc1706.html

For a tool, the perl sockets module might be a quick start.
 
  


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
Dialog box help!!!!!!!! HopelessLinuxNewbie Fedora 1 08-24-2005 11:48 AM
Dialog cookie_ie Programming 5 04-11-2005 01:48 AM
dialog ziox Programming 1 03-16-2005 01:09 PM
Dialog phatbastard Linux - Security 3 12-13-2004 09:48 PM
How to center a dialog? Fe98 Programming 0 11-09-2003 01:16 PM

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

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