Subject: | Net::DNS::Resolver 1.11 cannot get a reply once udppacketsize is set to 512 (PACKETSZ) |
In the below example after setting udppacketsize to 512 (PACKETSZ) a response is no longer possible.
#!/usr/bin/env perl
#
use strict;
use warnings;
use Net::DNS 1.11 ();
use Net::DNS::Resolver ();
use Test::More tests => 3;
my $domain_that_requires_noedns = 'boarderhouse.ch'; # dig boarderhouse.ch @dns1.mhs.ch +noedns +short ok
my $resolver = Net::DNS::Resolver->new();
$resolver->recurse(0);
$resolver->usevc(0);
$resolver->nameservers('213.188.32.64');
my $reply_before = $resolver->query( $domain_that_requires_noedns, 'A' );
ok( $reply_before, "Reply received when udppacketsize unset" );
$resolver->udppacketsize(0);
my $reply_after_zero_packet_size = $resolver->query( $domain_that_requires_noedns, 'A' );
ok( $reply_after_zero_packet_size, "Reply received when udppacketsize set to 0" );
$resolver->udppacketsize( Net::DNS::Resolver::Base::PACKETSZ() );
my $reply_after_packetsz_packet_size = $resolver->query( $domain_that_requires_noedns, 'A' );
ok( $reply_after_packetsz_packet_size, "Reply received when udppacketsize set to PACKETSZ (512)" );