dchau has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to write a perl script that will do a nslookup on a certain domain and grep for its ip. What i want to do is kill the ttl on the domain, it this possible in perl?
loop nslookup "domain" get ip log ip kill ttl end loop
I need to check dns persistence..........and log all the diffrent ips the domain will return. Thanks

Replies are listed 'Best First'.
Re: Kill TTL with perl?
by jepri (Parson) on May 23, 2001 at 22:15 UTC
    Don't use nslookup at all. It's broken. If you must use shell commands, try dnsquery. To do it nicely in Perl, trying reading through Net::DNS. Otherwise I think you can use the gethostbyaddr family of functions.

    I don't know what you mean by 'kill TTL' though. DNS queries have a TTL, like all other packets, and zone files have a set cache timeout (the 'DNS' TTL). But you can't alter that on someone elses DNS and you can clear the cache on your local DNS server by restarting it.

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.