Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

Security

Reply
Highlighted

API question concerning Infoblox:DNS:Zone object

Techie
Posts: 11
2846     0

I have a perl script that uses the Infoblox API to query an appliance for all the zones it is hosting. I didn't write the script but I am trying to modify it. The perl script queries the Infoblox:Smiley Very HappyNS::Zone object and uses the zone() method to get the names of all the DNS zones on the appliance. These names are then plugged into a named.conf file which is distributed to a group of anycast servers.Here is the problem: The reverse zone names for IPv4 and IPv6 zones are not formatted properly and have to be munged to provide a value suitable to be plugged into a named.conf file. I did some poking around and grabbed this array of hashes: @zones = $session->get( object => 'Infoblox:Smiley Very HappyNS::Zone' );Since @zones is really just an array of hash references, I looped through all the zones and printed out every key/value pair that was returned. Now, I didn't use the object methods, I just dereferenced the hashes to look at key/value pairs.I discovered each zone hash has a key named "display_domain" which contains a zone name that is ALREADY in the proper format to be plugged directly into my named.conf file. This appears to be true for both IPv4 and IPv6 reverse zones. I would like to know if it would be reasonable to discontinue using the name() method and just get the dereferenced key/value pair for "display_domain?" There is no object method that will return the "display_domain" which is apparently what I want. The only downside I can see would be if Infoblox later removed the key/value pair for "display_domain" from the Infoblox:Smiley Very HappyNS::Zone object without warning. Then my script would be broken.Are there any gotchas with just dereferencing the $zone hash reference and grabbing the "display_domain" value?

Highlighted

Re: API question concerning

Employee
Employee
Posts: 171
2847     0

what version are you working with? With version six and later, there is a display_domain() capability.

$zone->display_domain() should be available.

Highlighted

Re: API question concerning

Techie
Posts: 11
2847     0
We're using 6.1.0 (yeah, we really need to upgrade!) and there is no display_domain() method. However, the display domain hash key and value are there! I opened a ticket with support and they advised against directly accessing the hash key/value pairs. I may upgrade our dev appliance and see if the display_domain() method is available in a newer version.The other thing I'm doing is writing a perl subroutine to take the $zone->name() and check to see if it's a reverse zone, then if it is, rewrite it as a valid zone name that I can put in the named.conf file. I'm learning more about IPv6.
Showing results for 
Search instead for 
Do you mean 

Recommended for You