Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I am trying to make DNS filter where I can send 'A' entry for some of the requested domains and redirect the request to a real DNS server if no domain matched.
I am stucked with the fact that tools like 'nslookup' send un-understandable characters to my perl script so I am unable to match anything and stopped working on the code until I get some help.
Here is my code:
use IO::Socket; my $server = IO::Socket::INET->new( Proto => 'udp', LocalPort => 53, ); die "Couldn't setup server: $@" unless $server; while ( $server->recv(my $data , 1024, my $flag ) ) { print "Got: $data\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DNS filter
by Corion (Patriarch) on Feb 09, 2010 at 20:13 UTC | |
by Anonymous Monk on Feb 10, 2010 at 00:07 UTC | |
by gman (Friar) on Feb 10, 2010 at 02:20 UTC |