Hi Remco,

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.


Cheers,
Bruno

Reply via email to