Free Web Hosting Forum
Go Back   Free Web Hosting Forum > Website Building > Web Programming
Reload this Page IP instead of domain name to connect
Reply
 
Thread Tools Display Modes
(#1 (permalink))
Old
Junior Member
tikka308 is on a distinguished road
 
Posts: 2
Join Date: Aug 2012
Default IP instead of domain name to connect - 08-14-2012, 07:50 PM

I'm trying to connect to my site arduino.comule.com (which currently shows a ¿ for testing purposes) through the sketch below, which is an Arduino program. The problem is I cannot figure out how to resolve arduino.comule.com to the correct IP to use. If I do a ping, I get 31.170.162.43 - but typing that IP into a browser doesn't take me to my site. Any advice?


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

// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress server(173,194,33,104); // Google

// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;

void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}

// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
for(;
;
}
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println("connecting...");

// if you get a connection, report back via serial:
if (client.connect(server, 80)) {
Serial.println("connected");
// Make a HTTP request:
client.println("GET /search?q=arduino HTTP/1.0");
client.println();
}
else {
// kf you didn't get a connection to the server:
Serial.println("connection failed");
}
}

void loop()
{
// if there are incoming bytes available
// from the server, read them and print them:
if (client.available()) {
char c = client.read();
Serial.print(c);
}

// if the server's disconnected, stop the client:
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();

// do nothing forevermore:
for(;
;
}
}
Reply With Quote
Sponsored Links
(#2 (permalink))
Old
d3iti's Avatar
Super Moderator
d3iti is on a distinguished road
 
Posts: 6,520
Join Date: Jul 2009
Location: Spain
Default 08-14-2012, 08:40 PM

Hello,

The IP address corresponds to the server. The server is shared by other users.

000webhost free service does not provide a dedicated IP you can use.

In addition to the IP you must use the name of your website.


Recuerda realizar copias de seguridad de tus sitios web. Si este mensaje te ayudó puedes pulsar sobre el botón karma
Reply With Quote
(#3 (permalink))
Old
Junior Member
tikka308 is on a distinguished road
 
Posts: 2
Join Date: Aug 2012
Default 08-14-2012, 08:45 PM

OK - thanks, that makes sense - but I've been playing around with various iterations. According to my control panel, my website IP is 31.170.160.112 and file system path is /home/a7385954. Shouldn't I be able to type in http://31.170.160.112/home/a7385954 to arrive at my site?

Quote:
Originally Posted by d3iti View Post
Hello,

The IP address corresponds to the server. The server is shared by other users.

000webhost free service does not provide a dedicated IP you can use.

In addition to the IP you must use the name of your website.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com