Jump to content

dns, hosts question


Recommended Posts

I know how to edit the systems hosts file to point a url to a local server rather than a public dns...

Can I direct a path to a file on the same machine


If i open firefox and go to www.wikipedia/elephants.com i want it to open the saved version i have in my documents rather than the ip address of wikipedia.

Link to comment
Share on other sites

Well, yes and no. No because you're browser is going to try and go to the internet for the name, but yes, because you can change the IP to your own machines in the hosts file, but you're going to need to install something like Apache, and drop in the files for the www directory and serve them from your local IP, or when you then put the name in, it will look at your IP via the hosts file and make it look for it locally running off your own web server service. An easy way to do this(although insecure, so use a VM usually or sandboxed machine) install LAMP/WAMP if on windows, and if on Linux, Apache may be installed already.

Personally, I would download a VM like Turnkey Linux setup for using to host a webserver, and set the VM to bridged mode so it can get an IP from your router/gateway, even hardcode it on the servers config to use a static address, then point your hosts file to the VM, and upload the files to the VM's Apache WWW directory or whatever its config path is, ie: /var/www or /var/public_html/, etc.


Make sure you change all the default passwords for mysql, phpmyadmin, root, etc.

Edited by digip
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...