WIZNet W5500 with additional enhancements
Fork of WIZnetInterface by
Diff: Socket/DNSClient.cpp
- Revision:
- 34:7d44648ec5f2
- Parent:
- 0:6f28332c466f
--- a/Socket/DNSClient.cpp Sat Oct 07 22:10:01 2017 +0200
+++ b/Socket/DNSClient.cpp Mon Oct 09 19:58:19 2017 +0200
@@ -113,7 +113,12 @@
m_udp->init();
m_udp->set_blocking(false);
Endpoint server;
- server.set_address("8.8.8.8", 53); // DNS
+
+ if (m_dnsServer) {
+ server.set_address(m_dnsServer, 53); // DNS
+ } else {
+ server.set_address("8.8.8.8", 53); // DNS
+ }
m_udp->bind(rand()&0x7fff);
uint8_t buf[256];
int size = query(buf, sizeof(buf), hostname);
@@ -159,8 +164,9 @@
}
}
-bool DNSClient::lookup(const char* hostname) {
+bool DNSClient::lookup(const char* hostname, uint32_t dnsServer) {
m_hostname = hostname;
+ m_dnsServer = dnsServer;
m_state = MYNETDNS_START;
while(1) {
poll();
Helmut Tschemernjak
