Convert DNS Export Into BIND Format

One bright sunny day I received a sloppy text file which was most likely exported through a zone AXFR and my task was to import the records into a CDN's DNS. The import was not very happy with it, however, I did figure out how to fix the issue without manually editing any data by converting the DNS export into BIND format.

The command is called named-compilezone and it's pretty awesome (included in the bind-utils pkg).  Essentially all you need to do is import the text file and write it out as raw, then import the raw and export as text. It's a two step process but you could make it a one-liner:

$ named-compilezone -f text -F raw -o YourFile.com.raw DomainName.com OriginalFile.txt && named-compilezone -f raw -F text -o YourNewFile.bind.text YourDomain.com YourFile.com.raw

Originally I found the idea on Internet Systems Consortium. In my opinion, they are one of the least known and thanked software companies that have greatly contributed to the internet infrastructure in general.

BINDbaɪnd/, or namedneɪmdiː/, is the most widely used Domain Name System (DNS) software on the Internet. On Unix-like operating systems it is the de factostandard.

The software was originally designed at the University of California Berkeley (UCB) in the early 1980s. The name originates as an acronym of Berkeley Internet Name Domain, reflecting the application's use within UCB. The software consists, most prominently, of the DNS server component, called named, a contracted form of name daemon. In addition, the suite contains various administration tools, and a DNS resolver interface library. The latest version of BIND is BIND 9, first released in 2000.
[credit goes to Wikipedia]

Share
Disqus Comments Loading...

Recent Posts

VMWare vSphere 6.7 ESXTOP Output Garbled

If your VMWare vSphere 6.x environment command output of esxtop looks like a bunch of garbled gibberish (it's actually CSV… Read More

February 28, 2019 7:39 pm 19:39

How To Run RoboCopy Backup in Parallel

From time to time Windows Admins will surprise you with band-aid and bubble gum scripts, that's entirely expected I think.… Read More

February 28, 2019 12:20 pm 12:20

Windows 10 GodMode - The Ultimate Administrator Shortcut

Have you ever wondered what life might be like if the Windows 10 OS somehow had a single folder that… Read More

February 28, 2019 7:58 am 07:58

Samsung Galaxy S9 G960/G965 Stock ROM Firmware Download

There could be any number of reasons for needing to flash manufacturer stock OEM firmware on a Samsung Galaxy S9… Read More

January 24, 2019 7:42 am 07:42

Output IP Address with ipconfig Findstr Ethernet Adapter

How many times have you entered  ipconfig /all at the command line to return a single IP address, then have to strain… Read More

January 20, 2019 12:39 am 00:39

AWS SES Assistance in Enterprise Market - A Must Read

Designing e-mail solutions on a large scale can be a complex and costly challenge for a business: you need to… Read More

December 25, 2018 4:01 pm 16:01