Ethernet - Ethernet.dnsServerIP()

Description

Returns the DNS server IP address for the device.

Syntax

Ethernet.dnsServerIP()

Parameters

none

Returns

the DNS server IP address for the device (IPAddress).

Example

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(10, 0, 0, 177);

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  Ethernet.begin(mac, ip);

  Serial.print("The DNS server IP address is: ");
  Serial.println(Ethernet.dnsServerIP());
}

void loop () {}