Question

I am a newcomer at the web part of programming and I was given a host. I uploaded a simple index.html file with one header(It is correct). If I then try to connect with the nameserver/ip (gotten with PuTTy) , I get an 404 error. I have tried many different stuff about folders , but I could not fix anything

Was it helpful?

Solution

The nameserver IP address is almost certainly not your hosting IP address. The nameserver is the server (probably owned by your host - but possibly an outsourced service) that converts the human readable domain name (such as www.domain.com) to an IP address the computer can connect to (such as 198.252.206.16 - the IP 4 address I get for www.stackoverflow.com). It acts as a giant lookup list of domain names and IP addresses, much like a telephone book or Yellow Pages.

Moreover, as your host will almost certainly be hosting many domains (tens or possibly hundreds) per server, you will need to use a domain name when attempting to connect to your web page - this will be needed for Apache or IIS to know how to route the request/which content to return to the browser. It will do this using the request header sent by the browser when requesting the page. If you are testing locally then localhost/127.0.0.1 will be good enough if you have a single site registered/single set of content in a wwwroot directory (or equivalent). Similarly a virtual server or dedicated server may well respond to requests by IP address if it is the only site/application registered on the server.

To use another real-world analogy, it is a bit like addressing an item of post to a town or village - without including the recipient name, street or house number - and then expecting it to be received and to get a response.

Some hosts provide temporary domain names for you to use before you purchase your domain name or whilst the domain name details are propagated to DNS servers around the world. This usually looks something like-

http://your-user.your-host.com/ or http://server.your-host.com/your-username/

If your host offers such a service then this should normally be detailed in their self-help pages, or the admin area where you set up the site. Clearly such a domain is not intended for "production" use, and you should purchase a domain name before using the site for anything other than testing - if only to allow you the flexibility to move to a new host in the future.

This is not a question for StackOverflow users though, and I strongly suggest you consult your host's documentation or contact them for further assistance.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top