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

dnsdist (on raspbian) does not start after reboot if network takes time to start #4131

Closed
jpmens opened this issue Jul 7, 2016 · 8 comments
Labels

Comments

@jpmens
Copy link
Contributor

jpmens commented Jul 7, 2016

$ apt-get install dnsdist
$ netstat -anp|grep dnsdist
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      7584/dnsdist
udp        0      0 127.0.0.1:53            0.0.0.0:*                           7584/dnsdist
unix  3      [ ]         STREAM     CONNECTED     18741    7584/dnsdist

$ dnsdist --client
Unable to read configuration from '/etc/dnsdist/dnsdist.conf'
Fatal error: connecting socket to 127.0.0.1:5199: Connection refused
@jpmens
Copy link
Contributor Author

jpmens commented Jul 7, 2016

After reboot, dnsdist comes up but doesn't use config from /etc/dnsdist/dnsdist.conf: showServers() shows an empty list.

If I disable dnsdist from launching via systemd, reboot and run

/usr/bin/dnsdist --local 192.168.1.190:53 --config /etc/dnsdist/dnsdist.conf --supervised --disable-syslog -u _dnsdist -g _dnsdist

as root, it comes up as expected, i.e. with my configuration.

@jpmens
Copy link
Contributor Author

jpmens commented Jul 7, 2016

The same occurs when disabling from systemd and starting via rc.local (heretic, I know).

Interestingly showServers() displays an empty list, but showRules() has part of the config:

#     Matches Rule                                               Action
0           0 Src: 192.168.1.130/32                              to pool homestuff
1           0 Regex: \.mens\.de$                                 to pool homestuff

Also, the webserver() is launched on address/port I configured.

@jpmens
Copy link
Contributor Author

jpmens commented Jul 7, 2016

The failure to add servers from the configuration is a timing problem: dnsdist reports that the network is unreacheable.

Jul 07 12:09:04 dnsa dnsdist[667]: Error creating new server with address 192.168.1.81: connecting socket to 192.168.1.81:53: Network is unreachable
Jul 07 12:09:04 dnsa dnsdist[667]: Error creating new server with address 192.168.1.80: connecting socket to 192.168.1.80:53: Network is unreachable
Jul 07 12:09:04 dnsa dnsdist[667]: Error creating new server with address 8.8.4.4: connecting socket to 8.8.4.4:53: Network is unreachable
Jul 07 12:09:04 dnsa dnsdist[667]: Error creating new server with address 192.168.1.10: connecting socket to 192.168.1.10:53: Network is unreachable
Jul 07 12:09:04 dnsa dnsdist[667]: Listening on 192.168.1.190:53
Jul 07 12:09:04 dnsa dnsdist[667]: dnsdist 0.0.988g1e88fb0 comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it according to the terms of the GPL version 2
Jul 07 12:09:04 dnsa dnsdist[667]: ACL allowing queries from: 127.0.0.0/8, 10.0.0.0/8, 100.64.0.0/10, 169.254.0.0/16, 192.168.0.0/16, 172.16.0.0/12, ::1/128, fc00::/7, fe80::/10

The only extremely primitive way I know how to fix this is to replace ExecStart=/usr/bin/dnsdist by ExecStart=/usr/bin/dnsdistjpm and do a sleep 5 in that script before starting dnsdist proper. It then works as expected.

@rgacogne
Copy link
Member

rgacogne commented Jul 7, 2016

How is the network configured? I would have naively expected After=network-online.target to prevent this kind of issue.

@zeha
Copy link
Collaborator

zeha commented Jul 7, 2016

network-online.target does not give strong guarantees really. If you need reachability of other hosts, you really need to retry for yourself...

@rgacogne
Copy link
Member

rgacogne commented Jul 7, 2016

Alright, the issue here is that dnsdist needs the server to be reachable when it's added. It's not something we can easily change because of the way we use connected sockets for UDP, though.

@jpmens
Copy link
Contributor Author

jpmens commented Jul 7, 2016

Network configured out of the box (Raspbian) with /etc/network/interfaces containing

auto lo
iface lo inet loopback

iface eth0 inet manual

No difference when configuring a static assignment.

@zeha
Copy link
Collaborator

zeha commented Jul 7, 2016

Note that the interesting line is the one saying "auto" or "allow-hotplug". Nevertheless, can't rely on the network being functioning immediately ...

@zeha zeha changed the title dnsdist package on Raspbian is incomplete dnsdist (on raspbian) does not start after reboot if network takes time to start Jul 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants