Reply

networks and network containers of all records

[ Edited ]
Authority
Posts: 36
4827     0

I’m trying to get all the objects/records associated to a zone. To accomplish this, I’m using the export function on the PAPI API “Infoblox:: DNS::AllRecords” (which is good).

 

Now, if I want to get the networks and network containers of those objects, will I have to run separate APIs (like, Infoblox:: DHCP::Network) on each object (in a loop) or is there any API to get all those information in 1 export file?

 

Thank you.

Re: networks and network containers of all records

Community Manager
Community Manager
Posts: 248
4828     0

You're essentially asking for almost all the data in the database. There is no restriction in NIOS that binds a domain to a single network or a network to a single domain.

 

My usual question is : Why are you trying to do this ?

What is the report that you want to generate and what does it look like ?

 

It is feasable that a zone could contain address in all the defined networks. For example, you could have 3 subnets: 10.0.0.0/24, 20.0.0.0/24, 30.0.0.0/24 and with addresses that point to records in 3 different domains:

 

10.0.0.1   -> gw10.routers.domain.org

10.0.0.20  -> NS1.servers.domain.org

10.0.0.100 -> dhcp10-100.dhcp.domain.org

20.0.0.1   -> gw20.routers.domain.org

20.0.0.20  -> NS2.servers.domain.org

20.0.0.100 -> dhcp20-100.dhcp.domain.org

30.0.0.1   -> gw30.routers.domain.org

30.0.0.20  -> NS3.servers.domain.org

30.0.0.100 -> dhcp30-100.dhcp.domain.org

 

We don't maintain an index of 'All the networks that point to this domain'

As such you would have to query the IP address of each record for it's network to build up the list.

 

The 'fastest' way to do this is to write some code that builds up all the networks, but eliminates unnecessary searches. You would do something like this :

 

- get the first A record from the domain, get it's ip address.

- get the network for this IP address :

 

                    my ( $network) = $session->search(
                       object  => "Infoblox::DHCP::Network" ,
                       contains_address => "10.0.0.1",
                       network_view => $network_view_object,
                    );

- store that network in a list

- get the 'network_container' for that network, store that in another list

 

- Calculate all the IP addresses for than network,

  and identify or eliminate any other DNS records in that domain as having the same network

 

- get another A record from whatever is left over,

- repeat the network search...

 

Sorting the DNS record list by ip address makes the elimination process fast, since you just jump to the first record that is outside the network and repeat, walking your way through the DNS records.

 

Depending on the size of the database, this can be done a lot faster if you just pull ALL the networks and the DNS records once, and then do the processing offline with some sorted arrays.

 

 

Re: networks and network containers of all records

Authority
Posts: 36
4828     0

Thank you, Geoff. I was actually following the same steps as you mentioned. I just needed to know if there's any other faster way to do this.

 

I'm accepting this as the solution.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You

Businesses are investing heavily into securing company resources from cyber-attacks form cybercrimin