AnyEvent::DNS blocks on windows when no DNS available
Cotter, Dan
Dan.Cotter at auspost.com.au
Fri Oct 21 04:28:45 CEST 2022
Hi,
On windows, AnyEvent::DNS blocks when calling the Net::DNS::Resolver constructor when windows has no network adaptors with DNS.
It seems that localhost is included in the default nameserver list, and the constructor attempts to communicate with localhost if there are otherwise no nameservers.
Due to the default retrans and retry settings, this blocks for a combined 150 seconds on dual stack PC's.
Example (run on windows with no DNS available):
use AnyEvent;
use AnyEvent::DNS;
my $cv = AnyEvent->condvar;
my $tm = AnyEvent->timer(after=>1,interval=>1,cb=>sub{print ".\n"; }); # Never fires
AnyEvent::DNS::a "www.google.de", $cv; # Blocks for 150s
my @addrs = $cv->recv;
A suggested fix is to empty the defaults before the constructor is used to determine name servers:
Net::DNS::Resolver->nameserver4([]);
Net::DNS::Resolver->nameserver6([]);
Though technically this would change behavior for someone running a DNS server at localhost...?
Regards,
Dan
Dan Cotter
Engineering Design & Reliability
Engineering Services
Australia Post
5 Birdwood Cres.
REDBANK
QLD
4301
T 0433599611
M 0433 599 611
E Dan.Cotter at auspost.com.au
Australia Post acknowledges the Traditional Custodians
of the land on which we operate, live and gather as
a team. We recognise their continuing connection
to land, water and community. We pay respect to Elders
past, present and emerging.
Australia Post is committed to providing our customers with excellent service. If we can assist you in any way please telephone 13 13 18 or visit our website.
The information contained in this email communication may be proprietary, confidential or legally professionally privileged. It is intended exclusively for the individual or entity to which it is addressed. You should only read, disclose, re-transmit, copy, distribute, act in reliance on or commercialise the information if you are authorised to do so. Australia Post does not represent, warrant or guarantee that the integrity of this email communication has been maintained nor that the communication is free of errors, virus or interference.
If you are not the addressee or intended recipient please notify us by replying direct to the sender and then destroy any electronic or paper copy of this message. Any views expressed in this email communication are taken to be those of the individual sender, except where the sender specifically attributes those views to Australia Post and is authorised to do so.
Please consider the environment before printing this email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/anyevent/attachments/20221021/e2571e67/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image273920.png
Type: image/png
Size: 2901 bytes
Desc: image273920.png
URL: <http://lists.schmorp.de/pipermail/anyevent/attachments/20221021/e2571e67/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image428323.png
Type: image/png
Size: 4558 bytes
Desc: image428323.png
URL: <http://lists.schmorp.de/pipermail/anyevent/attachments/20221021/e2571e67/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image882777.png
Type: image/png
Size: 179 bytes
Desc: image882777.png
URL: <http://lists.schmorp.de/pipermail/anyevent/attachments/20221021/e2571e67/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image573108.png
Type: image/png
Size: 81857 bytes
Desc: image573108.png
URL: <http://lists.schmorp.de/pipermail/anyevent/attachments/20221021/e2571e67/attachment-0011.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image476625.png
Type: image/png
Size: 6119 bytes
Desc: image476625.png
URL: <http://lists.schmorp.de/pipermail/anyevent/attachments/20221021/e2571e67/attachment-0012.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image801315.png
Type: image/png
Size: 9447 bytes
Desc: image801315.png
URL: <http://lists.schmorp.de/pipermail/anyevent/attachments/20221021/e2571e67/attachment-0013.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image028304.png
Type: image/png
Size: 6902 bytes
Desc: image028304.png
URL: <http://lists.schmorp.de/pipermail/anyevent/attachments/20221021/e2571e67/attachment-0014.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image474176.png
Type: image/png
Size: 6979 bytes
Desc: image474176.png
URL: <http://lists.schmorp.de/pipermail/anyevent/attachments/20221021/e2571e67/attachment-0015.png>
More information about the anyevent
mailing list