Home: General Discussions: General Questions:
Create PTR Record using Net::DNS

New User

Feb 3, 2012, 11:12 AM

Views: 34590
Create PTR Record using Net::DNS

First, the relevant xkcd comic: http://xkcd.com/979/

Next, the 10-year old thread on PerlMonks: http://www.perlmonks.org/?node_id=210422

Basically, I'm failing in my attempts to use Net::DNS::Update to create a PTR record and I'd like to see how others have manged this.

Below is what I'm trying. $hst is the hostname that I already have an A record for. $rev is the backwards IP address in-addr.arpa thingy.

# Create the update packet: 
my $update = Net::DNS::Update->new($OURDOMAIN);

# Add the PTR record:
$update->push(update => rr_add("$rev 3600 PTR $hst"));

# Send the update to the zone's primary master.
my $res = Net::DNS::Resolver->new;

New User

Feb 7, 2012, 6:14 PM

Views: 34486
Re: [c0t0d0] Create PTR Record using Net::DNS

Resolved. Do a 'dig -x' on a valid IP address on the network. The "AUTHORITY SECTION" shows the in-addr.arpa zone to use for the 'new Net::DNS::Update' parameter.