how to listen to port 53 (DNS)

Discussion in 'Java' started by =?ISO-8859-1?Q?Daniel_G=F3mez?=, May 30, 2004.

  1. 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.
     
    =?ISO-8859-1?Q?Daniel_G=F3mez?=, May 30, 2004
    #1
    1. Advertising

  2. 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
     
    Mark Thornton, May 30, 2004
    #2
    1. Advertising

  3. 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
     
    =?ISO-8859-1?Q?Daniel_G=F3mez?=, May 30, 2004
    #3
  4. 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

    >
    >
     
    Mark Thornton, May 30, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jonah Olsson
    Replies:
    1
    Views:
    706
    Jonah Olsson
    Oct 7, 2004
  2. Donny
    Replies:
    13
    Views:
    701
    Donny
    Aug 5, 2004
  3. Gerald Klix
    Replies:
    0
    Views:
    1,325
    Gerald Klix
    Oct 26, 2005
  4. Sam Roberts
    Replies:
    0
    Views:
    245
    Sam Roberts
    Mar 20, 2005
  5. gavino
    Replies:
    2
    Views:
    190
    Ted Zlatanov
    Jul 27, 2006
Loading...

Share This Page