-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Enable the DNS resolution in examples by default #21116
base: master
Are you sure you want to change the base?
Enable the DNS resolution in examples by default #21116
Conversation
dcd6bec
to
9f15342
Compare
# Optionally include remoteDNS support. This includes resolution of names at an | ||
# upstream DNS server and the handling of RDNSS options in Router Advertisements | ||
# to auto-configure that upstream DNS server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's now longer optionally if it is the default? I mean, not wrong but sounds misleading. I also believe you should add a pointer that disabling it is safe and yields smaller builds.
# USEMODULE += sock_dns # include DNS client | ||
# USEMODULE += gnrc_ipv6_nib_dns # include RDNSS option handling | ||
USEMODULE += sock_dns # include DNS client | ||
USEMODULE += gnrc_ipv6_nib_dns # include RDNSS option handling | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might also want to enable the dns_cache
module - otherwise you'll make a new DNS request each time you resolve an address.
Might be worth adding a dns_default
pseudo-module that includes all that, so a user only has to enable a single module for full DNS support.
Contribution description
The example applications
gnrc_networking
andpaho-mqtt
are quite useful for testing and/or demonstrating RIOT's networking capabilities. For convenience the use of hostnames instead of IP addresses is preferable. So far, DNS resolution has been disabled by default. IMO it would be much nicer - particularly for newbies, if DNS resolution would work out of the box.The downside: approx. 3k more ROM and about 160 Bytes more RAM usage (on ARM-Cortex). So, I expect this PR to fail on some constrained platforms. However, I think for an example application this is still bearable.
Testing procedure
Test with native
dist/tools/tapsetup/tapsetup -c 1 -u eth0
).make -C example/paho-mqtt clean all term
.con test.mosquitto.org
Test on 6lowpan hardware
BOARD=nrf52840dk make -C example/paho-mqtt clean all flash term
.con test.mosquitto.org
Issues/PRs references
Another PR which configures a DNS resolver on the 6lbr example by default is about to come.