Michal Rogozinski
Michal Rogozinski

Reputation: 1759

parser in C# for zone file used by named/bind

I'm looking for a bind/named zone file parser in .NET C#. If there is anything I could import/convert I would be interested too. Unfortunately there's not much, or I'm having troubles finding it.

My goal is to make sure a zone file is syntax-errors-free before I push it to the server.

I'd appreciate any help or hints. Thanks

Upvotes: 2

Views: 1542

Answers (2)

Alnitak
Alnitak

Reputation: 340045

Absent a recommendation for a C# library (I use C, so don't know of one), you could shell out to the Win32 command line version of named-checkzone which is part of the BIND distribution.

Alternatively, the ldns C library has a zone file reader, if you're able to link in native C code to your C# project.

Upvotes: 2

Jonathan Stanton
Jonathan Stanton

Reputation: 2660

Have you tried sending dynamic updates to the bind server? This way you can specify what you want adding in to a zone file and bind handles the correct processing of your request. I have seen a component out there that will allow you to connect to a bind server and send updates to it. I will have a look to see if I can find the control for you.

Update - You can use nsupdate.exe to send a file with the changes that you want to make to the server

There is also a com component that can do this progamatically http://www.noeld.com/programs.asp?cat=dev#DnsLib

Upvotes: 0

Related Questions