netlib: support checkipconnectivity when use reslov.conf#3460
netlib: support checkipconnectivity when use reslov.conf#3460zhhyu7 wants to merge 1 commit intoapache:masterfrom
Conversation
Improve netlib_check_ipconnectivity() to support DNS nameservers from resolv.conf via dns_foreach_nameserver(), instead of relying on the compile-time CONFIG_NETDB_DNSSERVER_IPv4ADDR macro. Signed-off-by: wenquan1 <wenquan1@xiaomi.com>
|
@zhhyu7 it's not a good method to use ping to check if DNS server is reachable. Here is the reason: So a DNS server may:
If you want to test DNS reachability, use a DNS query like nslookup, dig, or host, not ping. And we need move further: |
@masc2008, You're right. Regarding NTP, I think we should directly remove the netlib_check_ipconnectivity check from the ntpclient file, because we already have backoff behavior to avoid screen flooding. Meanwhile, I will add a new patch later to select a more appropriate IP address for the check, such as DRaddr, and also add support for IPv6 addresses. |
|
thanks! Good job HongYu!👍
…On Wed, 22 Apr 2026 at 21:39, zhhyu7 ***@***.***> wrote:
*zhhyu7* left a comment (apache/nuttx-apps#3460)
<#3460?email_source=notifications&email_token=AEIQS6OZIYF2Y6WWNXTS7F34XDDRLA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMRZGY3DONJUGIYKM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJNLQOJPWG33NNVSW45C7N5YGK3S7MNWGSY3L#issuecomment-4296675420>
@zhhyu7 <https://github.com/zhhyu7> it's not a good method to use ping to
check if DNS server is reachable. Here is the reason: A DNS server is only
required to answer DNS queries on port 53 over UDP/TCP. Replying to ping
means replying to ICMP Echo, which is separate and optional.
So a DNS server may:
- answer DNS normally
- ignore or block ping
- be behind a firewall that drops ICMP
If you want to test DNS reachability, use a DNS query like nslookup, dig,
or host, not ping.
And we need move further: It's not good practice to just check network
connectivity via ping ipv4 address, the device may just have an IPv6
address only.
@masc2008 <https://github.com/masc2008>, You're right. Regarding NTP, I
think we should directly remove the netlib_check_ipconnectivity check from
the ntpclient file, because we already have backoff behavior to avoid
screen flooding. Meanwhile, I will add a new patch later to select a more
appropriate IP address for the check, such as DRaddr, and also add support
for IPv6 addresses.
—
Reply to this email directly, view it on GitHub
<#3460?email_source=notifications&email_token=AEIQS6OZIYF2Y6WWNXTS7F34XDDRLA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMRZGY3DONJUGIYKM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJNLQOJPWG33NNVSW45C7N5YGK3S7MNWGSY3L#issuecomment-4296675420>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEIQS6OGLDI3RFJ5NLGD2ID4XDDRLAVCNFSM6AAAAACYCBRKC6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DEOJWGY3TKNBSGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Summary
Improve netlib_check_ipconnectivity() to support DNS nameservers from resolv.conf via dns_foreach_nameserver(), instead of relying on the compile-time CONFIG_NETDB_DNSSERVER_IPv4ADDR macro.
Impact
Testing
Verify netlib_check_ipconnectivity(NULL, ...) pings DNS servers from resolv.conf and ram.