Subject: | Net::DNS::Nameserver malformed message on big axfr |
Date: | Sun, 19 Nov 2017 01:41:46 +0100 |
To: | bug-Net-DNS [...] rt.cpan.org |
From: | Csillag Tamas <cstamas [...] digitus.itk.ppke.hu> |
Hi,
I created a simple code to send ixfr and axfr replies with
Net::DNS::Nameserver.
The basic functionality works well. When I reach a certain size dig complains
about a bad packet and hungs up the connection.
; <<>> DiG 9.10.3-P4-Debian <<>> +tcp -t axfr example.com @192.168.121.139
;; global options: +cmd
example.com. 3600 IN SOA test.example.com. hostmaster.example.com. 21 10800 3600 604800 3600
example.com. 3600 IN NS test1.example.com.
example.com. 3600 IN NS test10.example.com.
test1000000.example.com. 3600 IN A 125.233.234.248
test100000.example.com. 3600 IN A 21.120.82.94
test200000.example.com. 3600 IN A 31.208.103.174
[...]
test953100.example.com. 3600 IN A 1.1.253.193
;; WARNING: ID mismatch: expected ID 54921, got 14
;; Warning: query response not set
;; Got bad packet: bad label type
256 bytes
[...]
I have a synthetic zone with 50k records and code to reproduce the data which
are here: http://cstamas.hu/priv/2017-11-19-g1Hw/
This is in kvm/qemu and i run stuff as root the distro is debian jessie.
libnet-dns-perl 1.07-1
This is the script's output:
root@test1:~# perl dnsserver.pl
big answer prepared
Creating TCP socket 192.168.121.139#53 - done.
Creating UDP socket 192.168.121.139#53 - done.
Waiting for connections...
TCP connection from 192.168.121.12:43671
Waiting for connections...
Received 42 octets from tcp:192.168.121.12:43671
Removed 2 octets from the input buffer from tcp:192.168.121.12:43671.
tcp:192.168.121.12:43671 said his query contains 40 octets.
query 8647 : example.com IN AXFR - Received query from 192.168.121.12 to 192.168.121.139
;; id = 8647
;; qr = 1 aa = 1 tc = 0 rd = 0 opcode = QUERY
;; ra = 0 z = 0 ad = 0 cd = 0 rcode = NOERROR
;; qdcount = 1 ancount = 50100 nscount = 0 arcount = 0
;; do = 0
Queued 1347387 octets to tcp:192.168.121.12:43671
Sent 111496 of 1347387 octets to tcp:192.168.121.12:43671.
Waiting for connections...
Received octets from tcp:192.168.121.12:43671
Connection to tcp:192.168.121.12:43671 closed or lost.
Waiting for connections...
Regards,
Tamas