Re: Renaming localhost

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 10, 2016 at 4:57 AM, Raja <raja@xxxxxxxxxx> wrote:
Hello,

I sometimes work in remote sites with no network. I have the same setup
on different machines and I need the server name to know dynamically
where to do changes, etc.

It's not clear to me the situation that you're describing above.

I edited /etc/hosts to show
127.0.0.1 localhost somename

Now, with my Wifi off I am trying `http://somename` and it is not
connecting. If I turn my wifi on, it works. But I need it to work with
no connection. How can I resolve this?

DNS is the system that resolves names to (numeric) hosts.

The /etc/hosts file on Linux systems is consulted first, before any (local or network) DNS server is consulted.

Therefore, the entry in /etc/hosts that you list above WILL map "http://somename" to the numeric address 127.0.0.1, which is the local machine.  

In order for this to actually produce a usable result, you must have a web server (e.g. Apache) running on the local machine, along with the proper configuration (e.g. /etc/apache2/conf-enabled/somename.conf) and files/scripts in the document root (e.g. /var/www/somename.com/index.html) to serve some website called "somename" from your local machine without using any network.
 
p.s. If you have the same set of files, and configuration to synchronize across multiple hosts (e.g. local, testing, production), you will need a tool like rsync; and be sure to use the --dry-run --verbose options.  Better yet, use git to commit your changes, and setup a "remotes" such as 'origin' and 'dev' to allow you to track, and push code changes.

Greg Rundlett
https://eQuality-Tech.com
https://freephile.org

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux