LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   /etc/hosts (https://www.linuxquestions.org/questions/linux-networking-3/etc-hosts-257813/)

vexer 11-21-2004 11:32 PM

/etc/hosts
 
Would adding a line in /etc/hosts (see below) allow me to browse to the hostname attributed to the ip entry?

Code:

x.x.x.x www.websearch.com

secesh 11-22-2004 02:42 AM

if x.x.x.x is hosting (virtually) websearch.com, then yes... take an example:

i have a dedicated server -- it hostes virtual sites (they share IPs).

when a new customer registers their site, they have to wait up to 2 days for DNS to go through before they are fully online.

but what if they want to work on their site before then?

-- /etc/hosts (and there is also a hosts file for windows)... put in an entry mapping their domain to my IP, and my host does the rest -- apache knows how to handle requests for their domain, so in a sense, all they have to do is ask my IP for their domain, and they get it!

--but if i have not yet put their domain on my host, and they just willy-nilly put stuff in their hosts file... my host won't know where to find their domain....


-- i run apache, and it comes down to the 'virtual host' entry -- basically if your webserver knows about the domain, you should be good...

follow that ramble?


All times are GMT -5. The time now is 07:23 PM.