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

Setting DNS server IP addresses #100

Closed
errordeveloper opened this issue Nov 1, 2013 · 8 comments
Closed

Setting DNS server IP addresses #100

errordeveloper opened this issue Nov 1, 2013 · 8 comments

Comments

@errordeveloper
Copy link

I was not able to figure out how to set the neserver IP address(es), seems like this is currently not exposed.

@adamgreen
Copy link
Contributor

I didn't see anything exposed from the C++ wrapper classes but lwIP supports the following C API that you should be able to use:

    void dns_setserver(u8_t numdns, ip_addr_t *dnsserver);

Set numdns to 0 to set the primary DNS server address.

Example:

#include <lwip/dns.h>

int main(void) {
    //

    // Set primary DNS to resolver1.opendns.com
    ip_addr_t primaryDnsServer;
    ip4_addr_set_u32(&primaryDnsServer, ipaddr_addr("208.67.222.222"));
    dns_setserver(0, &primaryDnsServer);

    //
}

@mbednotifications
Copy link

I suppose it would be best to actually expose it. Should it be a separate
method or optional initialisation argument?
Separate method would make sense to me, but optional argument is perfectly
fine too...
On 31 Oct 2013 23:54, "Adam Green" notifications@github.com wrote:

I didn't see anything exposed from the C++ wrapper classes but lwIP
supports the following C API that you should be able to use:

void dns_setserver(u8_t numdns, ip_addr_t *dnsserver);

Set numdns to 0 to set the primary DNS server address.

Example:

#include <lwip/dns.h>
int main(void) {
// …

// Set primary DNS to resolver1.opendns.com
ip_addr_t primaryDnsServer;
ip4_addr_set_u32(&primaryDnsServer, ipaddr_addr("208.67.222.222"));
dns_setserver(0, &primaryDnsServer);

// …}


Reply to this email directly or view it on GitHubhttps://github.com//issues/100#issuecomment-27550385
.

You received this message because you are subscribed to the Google Groups
"mbed-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to mbed-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

@adamgreen
Copy link
Contributor

I don't know who I am replying to here (mbednotifications) but here is my response anyway :)

I prefer the separate method as well. lwIP does default the primary DNS server to be the opendns one I used in my example above.

@errordeveloper
Copy link
Author

Ah, I made that mistake again... It was my reply. So OK, I'll add a separate method when I have a moment.

bridadan pushed a commit that referenced this issue Jun 21, 2016
Updated to latest uvisor-mbed-lib version
@ciarmcom
Copy link
Member

ciarmcom commented Aug 1, 2016

ARM Internal Ref: IOTMORF-329

@sg- sg- added enhancement and removed mirrored labels Aug 12, 2016
@sg-
Copy link
Contributor

sg- commented Aug 17, 2016

@geky Is this resolved with the updated DNS query?

@geky
Copy link
Contributor

geky commented Aug 17, 2016

Yes, though given the date, I'm assuming this issue was raised about the old EthernetInterface?

@sg-
Copy link
Contributor

sg- commented Aug 17, 2016

Updated with new EthernetInterface.

@sg- sg- closed this as completed Aug 17, 2016
deepakvenugopal added a commit to deepakvenugopal/mbed-os that referenced this issue Aug 9, 2018
…656a

cbe656a Fix 'unused variable' compiler - warning (ARMmbed#103)
1599c6b CoAP blockwise transfer support (ARMmbed#94)
40abace Update memory allocation and adjust trace (ARMmbed#102)
fc7bec3 Update unit test stub (ARMmbed#101)
4091f1b Check for coap_security_handler_connect_non_blocking return value (ARMmbed#100)

git-subtree-dir: features/nanostack/coap-service
git-subtree-split: cbe656a
linlingao added a commit to linlingao/mbed-os that referenced this issue Jul 12, 2019
Fixed a false assertion. Apparently NC is now allowed to passed to gp…
pan- added a commit to pan-/mbed that referenced this issue May 29, 2020
Updating mbed-os to mbed-os-5.5.4
artokin pushed a commit to artokin/mbed-os that referenced this issue Aug 21, 2020
…from 6d72419d8b..293edc63b8

293edc63b8 Merge pull request ARMmbed#100 from ARMmbed/update_from_mbedos
b5c79340aa Flag chrono functions to support Mbed OS 5.15
f623784a51 Revert "Revert "(via Mbed-OS)Use std::chrono based functions (ARMmbed#98)" (ARMmbed#99)"
273491840a Revert "(via Mbed-OS)Use std::chrono based functions (ARMmbed#98)" (ARMmbed#99)
4c1cf6e8ca (via Mbed-OS)Use std::chrono based functions (ARMmbed#98)
6c1e445c43 Merge pull request ARMmbed#97 from ARMmbed/IOTTHD-4181
3e5fd70b38 Atmel RF: Data whitening configurable
16d636242a Merge pull request ARMmbed#96 from ARMmbed/IOTTHD-3433
18aed62f22 Atmel RF: Check if given TX power is invalid and return -1
86492ad9f8 Atmel RF: Implemented TX power setting
fd1cd361f5 Allow PIN configuration using Mbed OS config (ARMmbed#95)

git-subtree-dir: connectivity/drivers/802.15.4_RF/atmel-rf-driver
git-subtree-split: 293edc63b87c4700579b14f2034ab152c0fb4f4c
artokin pushed a commit to artokin/mbed-os that referenced this issue Jun 22, 2021
…d80f42d..c343e4e2cc

c343e4e2cc Merge pull request ARMmbed#99 from PelionIoT/remove_ns_trace
70c411b0f8 Remove ns_trace.h
60e99d2c02 Update copyright (ARMmbed#100)

git-subtree-dir: features/frameworks/nanostack-libservice
git-subtree-split: c343e4e2ccb1517881ac85140974f3eb8cd85d46
artokin pushed a commit to artokin/mbed-os that referenced this issue Jun 23, 2021
…260d80f42d..c343e4e2cc

c343e4e2cc Merge pull request ARMmbed#99 from PelionIoT/remove_ns_trace
70c411b0f8 Remove ns_trace.h
60e99d2c02 Update copyright (ARMmbed#100)

git-subtree-dir: connectivity/libraries/nanostack-libservice
git-subtree-split: c343e4e2ccb1517881ac85140974f3eb8cd85d46
artokin pushed a commit to artokin/mbed-os that referenced this issue Jun 28, 2021
…d80f42d..c343e4e2cc

c343e4e2cc Merge pull request ARMmbed#99 from PelionIoT/remove_ns_trace
70c411b0f8 Remove ns_trace.h
60e99d2c02 Update copyright (ARMmbed#100)

git-subtree-dir: features/frameworks/nanostack-libservice
git-subtree-split: c343e4e2ccb1517881ac85140974f3eb8cd85d46
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

6 participants