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

Implement new config file that is honored regardless of MINIMAL configuration #65

Open
agoode opened this issue Sep 4, 2018 · 4 comments

Comments

@agoode
Copy link
Collaborator

agoode commented Sep 4, 2018

In issue #46 and #64, it is clear that we want to have at least these three options configurable independently in all cases:

  • Restrict to 169.254.0.0/16 for reverse lookup (currently true in MINIMAL, false otherwise)
  • Enable two-label limit heuristic (currently true in MINIMAL, false if non-MINIMAL and /etc/mdns.allow exists)
  • Enable unicast SOA heuristic (currently true in MINIMAL, false if non-MINIMAL and /etc/mdns.allow exists)

Right now, all configuration is done through /etc/nsswitch.conf and /etc/mdns.allow. If a MINIMAL variant is used, a set of hard coded settings are honored. For non-MINIMAL, a combination of different hard coded settings and configuration from /etc/mdns.allow is used.

I propose a new set of config files that can be used to specify all these parameters for any nss-mdns configuration:

  • /etc/nss-mdns.conf
  • /etc/nss-mdns_minimal.conf
  • /etc/nss-mdns4.conf
  • /etc/nss-mdns4_minimal.conf
  • /etc/nss-mdns6.conf
  • /etc/nss-mdns6_minimal.conf

We might not need all these files, in which case we'll just use /etc/nss-mdns.conf.

@lathiat
Copy link

lathiat commented Sep 4, 2018

I think the main angle of #64 is firstly that it broke after upgrade. While I understand that concern, I don't think that should be fixed and the default should match the expected standard as implemented in other operating systems, i.e. the current shipping version.

I don't mind the idea of allowing an option to allow >2-label hostname lookups in minimal-mode as a config option for users such as @Jack12816 who are relying on this behavior. But I don't think you should optimize for that case.

I find it relatively unlikely people are going to want to configure this behavior differently for IPv4 & IPv6. So I think if you want to go through the config file route, a single nss-mdns.conf would suffice.

But the second angle was that the only fix was to potentially have reverse dns lookups timeout slowly by using non-minimal.

Based on this logic

Enable two-label limit heuristic (currently true in MINIMAL, false if non-MINIMAL and /etc/mdns.allow exists)
Enable unicast SOA heuristic (currently true in MINIMAL, false if non-MINIMAL and /etc/mdns.allow exists)

Couldn't in theory you use mdns_minimal with an mdns.allow of:
.local.
.local
254.169.in-addr.arpa
8.e.f.ip6.arpa
9.e.f.ip6.arpa
a.e.f.ip6.arpa
b.e.f.ip6.arpa

To match the behavior they desire?

It is perhaps slightly obtuse, but I really think this is going to be a relatively uncommon use case. The only time this happens basically is if you setup entries in /etc/avahi/hosts - which I am sure some people have done, but I doubt it's many and this wouldn't happen with other operating systems.

Wouldn't that save adding extra configuration file logic over the existing logic, or have I misunderstood the logic and it doesn't actually work like that?

@lathiat
Copy link

lathiat commented Sep 4, 2018

Sorry I meant use mdns (not minimal). This basically lets you use mdns, resolve all .local hostnames including reverse hostnames, but only for the link local subnets (the normal _minimal behavior)

@imrehg
Copy link

imrehg commented Sep 14, 2018

The braking changes as #64 mentioned is an issue that got me here too. ArchLinux ships this by default, and your current readme says:

If the configuration file is absent or unreadable nss-mdns behaves mostly as if a configuration file with the following contents is read:

# /etc/mdns.allow
.local.
.local

which is clearly not the case. Thus it's both the breakage, and incorrect documentation.

@agoode
Copy link
Collaborator Author

agoode commented Sep 14, 2018

Sorry about the documentation. The wording was made clearer in fd0cab5.

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