- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Importing reverse zones from MS AD
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-21-2018 09:07 AM
Hello Guys,
I need to import upto 200 reverse records from AD which have the arpa format: 1.1.10-addr.arpa.net.
But to import these to infoblox I need to convert them to their respective IP/Netmask format like 10.1.1.0/24.
Is there a script to get this done or maybe some other script where I can feed it the notepad file with the arpa records and get the format changed as an output?
Thanks guys!
Solved! Go to Solution.
Re: Importing reverse zones from MS AD
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-21-2018 10:06 PM
In what format do you have them? It should be possible with sed/awk or just in excel as a csvto modify.
Re: Importing reverse zones from MS AD
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-21-2018 11:45 PM - edited 10-21-2018 11:56 PM
They are in the arpa addr format - 1.1.10.in-addr.arpa
Need to convert the excel colum to 10.1.1.0/24 so I can do the csv import.
Re: Importing reverse zones from MS AD
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-21-2018 11:58 PM
2 solutions
- awk
- echo "1.1.10.in-addr.arpa" | awk -F . '{print $3"."$2"."$1".0/24"}'
- will return "10.1.1.0/24"
- kinda klunky but will do the trick if it is for a few lines without too much variety
- Import wizard
- www.infoblox.com/import
- Much more flexible but the learning curve to deal with the tool ist steaper
- Requires you to export the files in the right format from MS
- Can generate importable CSV
Re: Importing reverse zones from MS AD
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-22-2018 01:01 AM
I have no idea what's awk. I know it's Linux based.
Is it available on the infoblox cli itself?
Re: Importing reverse zones from MS AD
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-22-2018 09:47 AM
Awk is not unique to linux, you can get it standalone or grab is through gnuwin32
Re: Importing reverse zones from MS AD
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-23-2018 12:07 AM
Hi,
If you are looking for a script that you can run from a Windows machine, you can try the following powershell script.
foreach ($a in (Get-Content .\in-addr_arpa_records.txt)) { $b = $a.Split(".") Write-Output "$($b[2]).$($b[1]).$($b[0]).0/24" | Out-File .\records_to_networks.txt -Append }
This assumes that your addresses are stored in the 1.1.10.in-addr.arpa format in the file "in-addr_arpa_records.txt", similar to the content below
1.1.10.in-addr.arpa 1.10.10.in-addr.arpa 10.10.10.in-addr.arpa 2.2.10.in-addr.arpa
The script creates an output file "records_to_networks.txt" with content similar to the following
10.1.1.0/24 10.10.1.0/24 10.10.10.0/24 10.2.2.0/24
Hope this helps,
Krishna
Re: Importing reverse zones from MS AD
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-29-2018 12:24 AM
Hey,
This looks perfect, will try it out.
Some reverse records are /8 and /16 so I think if I change the output line I can manage that too:
Write-Output "$($b[2]).$($b[1]).0/16"
Write-Output "$($b[1]).0/8"
But I am not sure if this will append to the text file correctly?
Am I doing this right? Should there be an OR statement between the 2 formats of output??

Re: Importing reverse zones from MS AD
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
10-29-2018 12:49 AM
Hello,
You can use the following script:
foreach ($a in (Get-Content .\in-addr_arpa_records.txt)) { $b = $a.Split(".") if($($b[1]) -eq "in-addr") { Write-Output "$($b[0]).0.0.0/8" | Out-File .\records_to_networks.txt -Append } elseif($($b[2]) -eq "in-addr") { Write-Output "$($b[1]).$($b[0]).0.0/16" | Out-File .\records_to_networks.txt -Append } else { Write-Output "$($b[2]).$($b[1]).$($b[0]).0/24" | Out-File .\records_to_networks.txt -Append } }
If the input file here is
20.in-addr.arpa 1.1.10.in-addr.arpa 1.10.10.in-addr.arpa 10.10.in-addr.arpa 2.2.10.in-addr.arpa 2.10.in-addr.arpa 10.in-addr.arpa
The output generated will be:
20.0.0.0/8 10.1.1.0/24 10.10.1.0/24 10.10.0.0/16 10.2.2.0/24 10.2.0.0/16 10.0.0.0/8
Hope this helps,
Krishna