Skip to content

Conversation

@bryanchriswhite
Copy link

Changes

image

@bryanchriswhite bryanchriswhite force-pushed the feat/runtime-zone-updates branch from 89c7fce to 1887f3e Compare May 15, 2023 15:41
@Olshansk
Copy link

Olshansk commented Jul 27, 2023

@ix64 @trois-six @foxcpp Any chance we can get a review on this or help by becoming repo maintainers?

func (r *Resolver) AddZone(name string, zone Zone) error {
r.zonesMutex.Lock()
defer r.zonesMutex.Unlock()

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if this canonicalized the name, since that's what the server tries to match during lookups.

Suggested change
name = dns.CanonicalName(name)

@horkhe
Copy link
Contributor

horkhe commented Jan 15, 2026

An alternative solution for the thread-safety issue has just been accepted from #21. Instead of introducing a mutex in Resolver it was Server that was made thread-safe and featuring AppendRR, DeleteRR and Reset functions for runtime zone manipulation.

At first I wanted to make Resolver thread-safe but without making the Zones field private that was impossible to achieve. So rather than breaking the package API I decided to follow the path of least resistance and update Server. It could be good enough for you too.

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

Successfully merging this pull request may close these issues.

4 participants