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

Ethernet.dnsServerIP() does not return the IP address I set with Ethernet.begin() #916

Closed
haveyouseenf opened this issue Jul 3, 2024 · 2 comments · Fixed by #918
Closed

Comments

@haveyouseenf
Copy link

While working with the Ethernet library on my Opta I stumbled upon this weird behavior. You can easily reproduce the issue with the following sketch:

#include <Ethernet.h>

IPAddress ip(192, 168, 10, 15);
IPAddress subnet(255, 255, 255, 0);
IPAddress dns(1, 1, 1, 1);
IPAddress gateway(192, 168, 10, 1);

void setup() {
  Serial.begin(9600);

  Ethernet.begin(ip, dns, gateway, subnet);

  Serial.print("IP = ");
  Serial.print(Ethernet.localIP());
  Serial.print(", DNS server = ");
  Serial.print(Ethernet.dnsServerIP());
  Serial.print(", Default gateway = ");
  Serial.println(Ethernet.gatewayIP());
}

void loop() {
}

On the serial monitor I get the following output:

IP = 192.168.10.15, DNS server = 8.8.8.8, Default gateway = 192.168.10.1

For some reason the DNS server always returns 8.8.8.8. If I can provide further details let me know!

@JAndrassy
Copy link
Contributor

what version of the Arduino Mbed platform do you have installed?

@haveyouseenf
Copy link
Author

I'm using mbed_opta version 4.1.3.

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 a pull request may close this issue.

2 participants