send UDP from arduino ethernet

how I can send udp packages to specific host in my network , if I change Udp.remoteIP( ) to 192,168,1,XX I have a mistake, only I want to send and not recive.

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

EthernetUDP Udp;
byte mac[] = {0x90, 0xA2, 0xDA, 0x0D, 0x5C, 0x18};
IPAddress ip(192,168,1,15);
unsigned int localport = 8888;

void setup(){
  Serial.begin(9600);
  Serial.println("****************");
  Serial.println("Puerto Serial OK");
  Ethernet.begin(mac,ip);
  Serial.print("IP : ");
  Serial.println(Ethernet.localIP());
  Udp.begin(localport);
}

void loop(){
  Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());   [glow=yellow,2,300][b]//  I want to specify a host[/b][/glow]
  Udp.println("Mensaje UDP");
  Serial.println("Mensaje UDP");
  Udp.endPacket();
  delay(5000);
}

This should work. I presumed the remote device IP is 192.168.1.16 and port 8888.

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

EthernetUDP Udp;
byte mac[] = {0x90, 0xA2, 0xDA, 0x0D, 0x5C, 0x18};
IPAddress ip(192,168,1,15);
unsigned int localport = 8888;

IPAddress remoteIP(192,168,1,16);
unsigned int remotePort = 8888;

void setup(){
  Serial.begin(9600);
  Serial.println("****************");
  Serial.println("Puerto Serial OK");
  Ethernet.begin(mac,ip);
  Serial.print("IP : ");
  Serial.println(Ethernet.localIP());
  Udp.begin(localport);
}

void loop(){
  Udp.beginPacket(remoteIP, remotePort);
  Udp.println("Mensaje UDP");
  Serial.println("Mensaje UDP");
  Udp.endPacket();
  delay(5000);
}

So, Do you know if there are any way to send a server on internet but not wiht its IP address remote? I want to send udp traffic to its domain name. For example:(it does not work , just an idea)

IPAddress remoteIP("www.testudp.com");
unsigned int remotePort = 8888;

how I can do that?

Yes, you can. This is from EthernetUdp.h.

// Start building up a packet to send to the remote host specific in ip and port
// Returns 1 if successful, 0 if there was a problem with the supplied IP address or port
virtual int beginPacket(IPAddress ip, uint16_t port);
// Start building up a packet to send to the remote host specific in host and port
// Returns 1 if successful, 0 if there was a problem resolving the hostname or port
virtual int beginPacket(const char *host, uint16_t port);

beginPacket("www.testudp.com",8888);