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

Create name server #63

Closed
K3nshin66 opened this issue Sep 15, 2019 · 3 comments
Closed

Create name server #63

K3nshin66 opened this issue Sep 15, 2019 · 3 comments

Comments

@K3nshin66
Copy link

hi
have an issue: I using local resolver (Not master file) and I need to have a name server [like Microsoft DNS Server config] for an external app like haproxy can calibrate with my DNS server.
how can I do that in this scenario?
am I missing something?

@K3nshin66
Copy link
Author

in another way how can I add NS record?

@danieljoos
Copy link
Contributor

Please see the example on the frontpage/README, where it states:

if (question.Type == RecordType.A) {
	IResourceRecord record = new IPAddressResourceRecord(
		question.Name, IPAddress.Parse("127.0.0.1"));
	response.AnswerRecords.Add(record);
}

It returns 127.0.0.1 for all requested A records.
Just use something like ConcurrentDictionary<string, IPAddress> (see the docs) to hold your records. Or even have some statically filled array or something.
Then make a lookup there and return the corresponding IPAddress.

Cheers.

@kapetan
Copy link
Owner

kapetan commented Aug 29, 2020

Thank you @danieljoos for helping out. Hoped it solved the issue.

@kapetan kapetan closed this as completed Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants