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

ddns-scripts: do not verify DNS server on start #24183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

feckert
Copy link
Member

@feckert feckert commented May 17, 2024

Maintainer: me
Compile tested: no only script changes
Run tested: x86_64, APU3, OpenWrt latest

Description:
Can any of @McGiverGim @jummo @maxberger check that the change does not generate regressions?
I had problem with my ddns update and debugged it and the problem is the DNS server check.

When the ddns update script is started, the system checks whether the configured DNS server can be reached. This is checked with the 'netcat' tool. The tool tries to establish a TCP connection on port 53 of the configured DNS server.

The problem with this implementation is, that this call blocks the ddns update script until 'netcat' returns from the call.

Verfification failed:
If the IP and the port cannot be reached, the netcat call returns immediately.

Verfification successfull:
If the IP and the port of the DNS server can be reached, the connection remains established and so the ddns update scripts blocks until the configured TCP session timeout of the DNS server resets the connection.

The behavior in the event of an successfull verificataion is a problem for the ddns update script if it is called via the hotplug. Since the ddns update script runs too long! This blocking behavior also depends on the TCP session timeout setting of the DNS server.

time netcat 1.1.1.1 53
netcat 1.1.1.1 53 0.00s user 0.00s system 0% cpu 10.016 total

time netcat 8.8.8.8 53
netcat 8.8.8.8 53 0.00s user 0.00s system 0% cpu 2.012 total

The TCP session timeout is for 1.1.1.1 10 seconds and for 8.8.8.8 2 seconds.

The '--wait' option of necat or the additional integration of the 'timeout' function of busybox was implemented for this behavior. But the used '--wait' function of netcat of the busybox shows no effect here.

Since the used implementation is not clean, the question arise why this is necessary for the ddns update script at all? As the nslookup throws an error anyway if it cannot resolve the IP. This check is only informative. The check does not affect the script behavior.

The check is therefore removed on ddns update.

When the ddns update script is started, the system checks whether the
configured DNS server can be reached. This is checked with the 'netcat' tool.
The tool tries to establish a TCP connection on port 53 of the configured
DNS server.

The problem with this implementation is, that this call blocks the ddns
update script until 'netcat' returns from the call.

Verfification failed:
If the IP and the port cannot be reached, the netcat call returns
immediately.

Verfification successfull:
If the IP and the port of the DNS server can be reached, the connection
remains established and so the ddns update scripts blocks until the
configured TCP session timeout of the DNS server resets the connection.

The behavior in the event of an successfull verificataion is a problem
for the ddns update script if it is called via the hotplug. Since the ddns
update script runs too long! This blocking behavior also depends on
the TCP session timeout setting of the DNS server.

> time netcat 1.1.1.1 53
netcat 1.1.1.1 53  0.00s user 0.00s system 0% cpu 10.016 total

> time netcat 8.8.8.8 53
netcat 8.8.8.8 53  0.00s user 0.00s system 0% cpu 2.012 total

The TCP session timeout is for 1.1.1.1 10 seconds and for 8.8.8.8 2 seconds.

The '--wait' option of necat or the additional integration of the 'timeout'
function of busybox was implemented for this behavior. But the used '--wait'
function of netcat of the busybox shows no effect here.

Since the used implementation is not clean, the question arise why this
is necessary for the ddns update script at all? As the nslookup throws an
error anyway if it cannot resolve the IP. This check is only informative.
The check does not affect the script behavior.

The check is therefore removed on ddns update.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
@jummo
Copy link
Contributor

jummo commented May 17, 2024

Works for me without issues.

@maxberger
Copy link
Contributor

Can't check at this time :(

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.

None yet

3 participants