all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Remco van 't Veer <remco@remworks.net>
To: Bruno Victal <mirai@makinata.eu>
Cc: Sergiu Ivanov <sivanov@colimite.fr>, help-guix@gnu.org
Subject: Re: Examples of local-host-entries or hosts-service-type?
Date: Thu, 02 Mar 2023 09:47:45 +0100	[thread overview]
Message-ID: <87sfenletq.fsf@remworks.net> (raw)
In-Reply-To: <931ac97b-c1a1-f35e-02c9-cfbaa4ec2b08@makinata.eu>

Hi Bruno,

2023/03/02 02:41, Bruno Victal:

> On 2023-02-27 06:23, Remco van 't Veer wrote:
>>
>> Or when you want to provide extra aliases for localhost?
>>
>> Like this?
>>
>>   (essential-services
>>    (modify-services
>>        (operating-system-default-essential-services this-operating-system)
>>      (hosts-service-type config =>
>>                          (list (host "127.0.0.1" "localhost" (list host-name "foo" "bar"))
>>                                (host "::1"       "localhost" (list host-name "foo" "bar"))))))
>
> Semantically you're right though I wouldn't outright do this unless it
> results in clearer code or if its really needed.
>
> Reason for this is that the format of /etc/hosts isn't consistently
> defined.
> For instance, there is a limit on the maximum number of
> aliases. (depending on the implementation)
>
> If I wanted to add extra aliases, I'd extend the service with new
> "standalone" host records instead though your snippet is just as
> valid, as long you don't go overboard with the number of aliases.

I not sure all applications will react well to having multiple entries
for the same IP-address.

From the hosts(5) manpage:

> This file is a simple text file that associates IP addresses with
> hostnames, one line per IP address.

To workaround the alias limit, picking multiple loopback addresses (for
the example above) would be a better solution, it seems.

Cheers,
Remco


  reply	other threads:[~2023-03-02  8:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10 22:40 Examples of local-host-entries or hosts-service-type? Sergiu Ivanov
2023-02-10 23:37 ` Bruno Victal
2023-02-11 11:46 ` Remco van 't Veer
2023-02-13 10:49   ` Sergiu Ivanov
2023-02-14  9:34     ` Remco van 't Veer
2023-02-21 15:33   ` Gary Johnson
2023-02-26 18:33     ` Sergiu Ivanov
2023-02-21 16:45   ` Bruno Victal
2023-02-26 18:05     ` Sergiu Ivanov
2023-02-27  6:23     ` Remco van 't Veer
2023-03-02  2:41       ` Bruno Victal
2023-03-02  8:47         ` Remco van 't Veer [this message]
2023-03-03 14:00           ` Bruno Victal
2023-03-03 16:16             ` Remco van 't Veer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sfenletq.fsf@remworks.net \
    --to=remco@remworks.net \
    --cc=help-guix@gnu.org \
    --cc=mirai@makinata.eu \
    --cc=sivanov@colimite.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.