Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > how to listen to port 53 (DNS)

Reply
Thread Tools

how to listen to port 53 (DNS)

 
 
=?ISO-8859-1?Q?Daniel_G=F3mez?=
Guest
Posts: n/a
 
      05-30-2004
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.

 
Reply With Quote
 
 
 
 
Mark Thornton
Guest
Posts: n/a
 
      05-30-2004
Daniel Gómez wrote:
> 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
 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?Daniel_G=F3mez?=
Guest
Posts: n/a
 
      05-30-2004
yes, I am using W2000. Shall I use DatagrammSocket instead?

Daniel
Mark Thornton schrieb:
> Daniel Gómez wrote:
>
>> 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


 
Reply With Quote
 
Mark Thornton
Guest
Posts: n/a
 
      05-30-2004
Daniel Gómez wrote:

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


Yes.

> Mark Thornton schrieb:
>
>> Daniel Gómez wrote:
>>
>>> 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

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Listen in promiscuous mode (Sniffer) on UDP port 162 and copypacketsto another port Gerald Klix Python 0 10-26-2005 08:11 AM
Using Web Service to listen on certain TCP port? Jonah Olsson ASP .Net 1 10-07-2004 02:02 PM
Bad ServerSocket ! Listen! Listen! Listen! Donny Java 13 08-05-2004 06:51 PM
Changing snmp-server listen port? JayDubb Cisco 4 03-03-2004 09:53 PM
How to add another listen port in Tomcat 4.X ? Ahan Hsieh Java 1 11-04-2003 09:02 PM



Advertisments