[Nix-dev] Adding hostnames to 127.0.0.1 in /etc/hosts

zimbatm zimbatm at zimbatm.com
Tue Mar 1 13:21:19 CET 2016


I don't know why [hostname]-encrypted exists but having multiple lines with
the same address is fine. You can also have multiple names on the same like
like:

127.0.0.1 node guzzle


On Tue, 1 Mar 2016 at 12:11 4levels <4levels at gmail.com> wrote:

> Dear Nix'ers,
>
> I've been wondering how all my deployed machines with NixOps, get this
> default hosts file layout (where [hostname] is the actual server's
> hostname):
>
> 127.0.0.1 localhost
> ::1 localhost
> 127.0.0.1 [hostname]-encrypted
>
> I was recently pointed to the fact that an IP address should only be
> present once in the hosts file as lookups happen in both directions (name
> -> ip and ip -> name).  Is this resulting hostfile invalid in any way or
> can I safely ignore this?
>
> I've searched the repo's and this seems to be done in
> nixops/deployment.py:426, as follows:
>
> hosts[m.name]["127.0.0.1"].append(m.name + "-encrypted")
>
> The reason I'm asking is that I need to add more names to the 127.0.0.1
> line, but I can't seem to do this on the first line (right after localhost)
> so I need to add another line starting with 127.0.0.1 to achieve this.
> This results in the hosts file now containing 3 separate lines starting
> with 127.0.0.1, listing different names on each line..
>
> I never ran into issues with hosts files containing the same IP address
> multiple times, so I'm just wondering how important this is since I'm
> having multiple local processes (node, guzzle) performing requests to the
> local machine for proxy purposes.
>
>
> Kind regards,
>
> Erik aka 4levels
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160301/d6c5eeb8/attachment.html 


More information about the nix-dev mailing list