May 4, 2009, 5:35 PM
Post #1 of 7
I have a perl script that resolv domain names and print their ip addresses . The script runs on Linux. But accidently I found if i update the content of /etc/resolv.conf when the script is running, say to a invalid nameserver, this script won't pick up the new nameserver
how can we update the nameserver when the script is running
# now update /etc/resolv.conf with invalid nameserver
`echo "nameserver null" > /etc/resolv.conf`;
Output of the script is :
In the above script the second name lookup still worked, even after the OS been told to use a invalid nameserver. So I am thinking perl remember the nameserver during the execution of the script.
Now my questoin is , how can we update the nameserver when the script is running?