Subject: | RES_OPTIONS does not allow colons in an option value |
Here is a trivial one: it is not possible to specify an IPv6 address
for a srcaddr through RES_OPTIONS environment variable:
RES_OPTIONS='srcaddr:2001:1470:ff80::53:64' ./your-program-here
The value gets truncated after the first colon resulting in srcaddr=2001.
The fix:
--- lib/Net/DNS/Resolver/Base.pm~
+++ lib/Net/DNS/Resolver/Base.pm
@@ -219,5 +219,5 @@
if (exists $ENV{'RES_OPTIONS'}) {
foreach ($ENV{'RES_OPTIONS'} =~ m/(\S+)/g) {
- my ($name, $val) = split(m/:/);
+ my ($name, $val) = split(m/:/,$_,2);
$val = 1 unless defined $val;
$config->{$name} = $val if exists $config->{$name};