how to listen to port 53 (DNS)

  • Thread starter =?ISO-8859-1?Q?Daniel_G=F3mez?=
  • Start date
?

=?ISO-8859-1?Q?Daniel_G=F3mez?=

hello,

I am trying to listen to port 53 on localhost in order to read the
received information and then forward it to another host (a DNS server)
on port 53. I have therefore written:

ServerSocket listen = new ServerSocket(53);
Socket data = listen.accept();

I have changed DNS server configuration to 127.0.0.1, so that all DNS
queries should arrive here. But when I try to access to an URL, so that
a DNS query is generated, nothing happens. I cannot hear anything on
port 53.

What am I doing wrong?

thank you.
 
M

Mark Thornton

Daniel said:
hello,

I am trying to listen to port 53 on localhost in order to read the
received information and then forward it to another host (a DNS server)
on port 53. I have therefore written:

ServerSocket listen = new ServerSocket(53);
Socket data = listen.accept();

I have changed DNS server configuration to 127.0.0.1, so that all DNS
queries should arrive here. But when I try to access to an URL, so that
a DNS query is generated, nothing happens. I cannot hear anything on
port 53.

What am I doing wrong?

thank you.

DNS queries are usually done using datagrams and not via sockets
(although I seem to remember that both are permitted). I'm assuming that
your operating system allows you to listen on port 53 (Windows will,
other OS may require appropriate permissions).

Mark Thornton
 
?

=?ISO-8859-1?Q?Daniel_G=F3mez?=

yes, I am using W2000. Shall I use DatagrammSocket instead?

Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top