Net::DNSServer::Proxy - Forwards requests to another DNS server


  #!/usr/bin/perl -w -T
  use strict;
  use Net::DNSServer;
  use Net::DNSServer::Proxy;

  my $resolver = new Net::DNSServer::Proxy {
    # Which remote server to proxy to
    real_dns_server => "",
    # Seconds to wait for its response
    patience => 2,

    -- or --

  # real_dns_server will default to the first
  # "nameserver" entry in /etc/resolv.conf.
  # patience will will default to
  # $Net:DNSServer::Proxy::default_response_timeout.
  my $resolver = new Net::DNSServer::Proxy;

  run Net::DNSServer {
    priority => [$resolver],


This resolver does not actually do any resolving itself. It simply forwards the request to another server and responds with whatever the response is from other server.


The new() method takes a hash ref of properties.

real_dns_server (optional)

This value is the IP address of the server to proxy the requests to. This server should have a nameserver accepting connections on the standard named port (53). It defaults to the first "nameserver" entry found in the /etc/resolv.conf file.

patience (optional)

Number of seconds to wait for a response from real_dns_server before timing out. It defaults to $Net:DNSServer::Proxy::default_response_timeout.


Rob Brown,


Net::Bind::Resolv, Net::DNSServer::Base, resolv.conf(5), resolver(5)


Copyright (c) 2002, Rob Brown. All rights reserved.

Net::DNSServer is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

$Id:,v 1.13 2002/11/13 19:57:24 rob Exp $