henzen has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I'm slow today for some reason - maybe too little coffee, and would appreciate some wisdom.
Net::DNS::Resolver->new(nameservers => [qw(1 2 3)]...
That's the usual usage, ie, hard coding the nameserver IPs. I want to use a variable such as @nameservers (or even the scalar $nameservers):
Net::DNS::Resolver->new(nameservers => [@nameservers]...
This works, but it only queries the first nameserver. The remainder are ignored (so it fails if the first NS is dead).
I cannot hard-code as $ns = qw(ip1 ip2 ip3 ip4), since the IPs are sourced from another variable and qw() doesn't interpolate (so I cannot do $ns = qw($ip1 $ip2 $ip3 $ip4))...
I just need to programmatically pass several nameserver IPs to Net::DNS::Resolver.
Any pointers to alleviate my dumbness would be appreciated. Thanks
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Net::DNS::Resolver and nameservers
by gam3 (Curate) on May 13, 2011 at 14:38 UTC | |
by henzen (Acolyte) on May 13, 2011 at 15:14 UTC | |
Re: Net::DNS::Resolver and nameservers
by jellisii2 (Hermit) on May 13, 2011 at 15:01 UTC | |
by henzen (Acolyte) on May 13, 2011 at 15:17 UTC | |
by MidLifeXis (Monsignor) on May 13, 2011 at 18:06 UTC | |
by Anonymous Monk on May 13, 2011 at 18:16 UTC |
Back to
Seekers of Perl Wisdom