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

[dns] resolution fails on linux if running avahi-daemon #14

Open
samschlegel opened this issue Aug 7, 2019 · 7 comments
Open

[dns] resolution fails on linux if running avahi-daemon #14

samschlegel opened this issue Aug 7, 2019 · 7 comments

Comments

@samschlegel
Copy link

If running avahi on Linux, it seems that it takes priority over the cluster.local. stub. dig works fine as that bypasses mDNS. Disabling avahi fixes name resolution.

@cppforlife
Copy link
Contributor

cppforlife commented Aug 7, 2019 via email

@samschlegel
Copy link
Author

I rely on it for printing and connecting to some servers on my LAN, so while disabling it unblocked running kwt, it's not a long term solution.

@cppforlife
Copy link
Contributor

cppforlife commented Aug 8, 2019

i see.

looks like currently i only enable mdns on os x:

https://github.com/k14s/kwt/blob/01506ff961c116370c4c7ceed1f6067d9630df57/pkg/kwt/cmd/net/dns_flags.go#L32 which controls https://github.com/k14s/kwt/blob/01506ff961c116370c4c7ceed1f6067d9630df57/pkg/kwt/cmd/net/dns_factory.go#L45

can you try running kwt net start command with --dns-mdns=true flag while avahi is running?

@samschlegel
Copy link
Author

Hmm. kwt picks up the mdns requests and answers about 20 times, but curl still errors due to not being able to resolve the host. avahi-resolve -n also times out.

@samschlegel
Copy link
Author

I could debug with Wireshark or something later, but for now I just adjusted my /etc/nsswitch.conf to not include [NOTFOUND=return] after mdns_minimal in order for it to fall back to DNS. Might also try using the built-in mDNS in systemd-resolved

@phluks
Copy link

phluks commented Sep 2, 2019

I fixed it by moving the "dns" flag before the "mdns" flag in the /etc/nsswitch.conf. My "hosts" entry in that file now looks like this:

hosts: files dns mdns4_minimal [NOTFOUND=return] myhostname

@RobertKielty
Copy link

RobertKielty commented Nov 10, 2019

@phluks Thanks for this, your solution works for me.
For passers-by, make sure that you have your hostname at the of the end line

@cppforlife thanks for bringing my attention to this issue in particular and thanks for the k14s in general. Brilliant work.

@cppforlife cppforlife pinned this issue Jan 22, 2021
@aaronshurley aaronshurley moved this to To Triage in Carvel Jul 26, 2022
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

4 participants