Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct parsing of bind files #120

Open
TropicalThunder opened this issue May 27, 2021 · 1 comment
Open

Direct parsing of bind files #120

TropicalThunder opened this issue May 27, 2021 · 1 comment

Comments

@TropicalThunder
Copy link

I might be entirely wrong... but is there a way to parse a raw zone/bind file? I haven't been able to find a simple way to parse zone files into C# objects. I would assume that DnsClient parses this internally as a response from a NS server... but is there a way to supply the file from text (disk, stream w/e), without accessing a NS server?

Basic example of zone file:

$ORIGIN example.com.
$TTL 86400
@ SOA dns1.example.com. hostmaster.example.com. (
2001062501 ; serial
21600 ; refresh after 6 hours
3600 ; retry after 1 hour
604800 ; expire after 1 week
86400 ) ; minimum TTL of 1 day
;
;
NS dns1.example.com.
NS dns2.example.com.
dns1 A 10.0.1.1
AAAA aaaa:bbbb::1
dns2 A 10.0.1.2
AAAA aaaa:bbbb::2
;
;
@ MX 10 mail.example.com.
MX 20 mail2.example.com.
mail A 10.0.1.5
AAAA aaaa:bbbb::5
mail2 A 10.0.1.6
AAAA aaaa:bbbb::6
;
;
; This sample zone file illustrates sharing the same IP addresses for multiple services:
;
services A 10.0.1.10
AAAA aaaa:bbbb::10
A 10.0.1.11
AAAA aaaa:bbbb::11

ftp CNAME services.example.com.
www CNAME services.example.com.
;
;

@MichaCo
Copy link
Owner

MichaCo commented May 27, 2021

No, DnsClient only reads wire format from a response from a server.
There is currently no code which reads a zone file.

I might add that at some point but I never needed it so far ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants