• Re: How to set domain name permanently?

    From Felix Miata@3:633/10 to All on Wednesday, September 30, 2026 15:10:01
    Chris Green composed on 2026-09-30 08:31 (UTC+0100):

    What's the 'right' way to set a system's domain name permanenty (i.e.
    doesn't get lost when you reboot) on Debian systems?

    I don't think setting /etc/hostname to the FQDN is correct as, if you do that, then 'hostname' returns the FQDN and it should only return the
    host's name without the domain.

    I already have the following in /etc/hosts:-

    127.0.1.1 t16.zbmc.eu t16

    but this doesn't seem to have the required effect.

    It can't be done in /etc/resolv.conf as this file is generated (in my
    case by Network Manager). Is there a Network Manager setting that will
    put the domain name in resolv.conf?

    How I do it:
    1-don't have NetworkManager installed
    2-have systemd-networkd installed
    3-don't have systemd-resolved or resolvconf installed
    4-configure systemd-networkd with static IP
    5-configure /etc/hostname & /etc/resolv.conf manually
    6-configure host in /etc/hosts

    My PCs are almost exclusively desktops, and none ever leave the building.
    --
    Evolution as taught in public schools is, like religion,
    based on faith, not based on science.

    Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

    Felix Miata

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Robert Heller@3:633/10 to All on Wednesday, September 30, 2026 15:20:01
    I think it is something set via DHCP and is something coming from the DHCP server. Do you have a DHCP server on your network? If you are setting the IP address *statically* then it is in /etc/network/interfaces (/etc/network/interfaces.d/*) OR somewhere under /etc/NetworkManager/

    At Wed, 30 Sep 2026 13:31:59 +0100 Chris Green <cl@isbd.net> wrote:


    What's the 'right' way to set a system's domain name permanenty (i.e.
    doesn't get lost when you reboot) on Debian systems?

    I don't think setting /etc/hostname to the FQDN is correct as, if you do that, then 'hostname' returns the FQDN and it should only return the
    host's name without the domain.

    I already have the following in /etc/hosts:-

    127.0.1.1 t16.zbmc.eu t16

    but this doesn't seem to have the required effect.

    It can't be done in /etc/resolv.conf as this file is generated (in my
    case by Network Manager). Is there a Network Manager setting that will
    put the domain name in resolv.conf?


    --
    Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
    Deepwoods Software -- Custom Software Services
    http://www.deepsoft.com/ -- Linux Administration Services
    heller@deepsoft.com -- Webhosting Services


    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Marco Moock@3:633/10 to All on Wednesday, September 30, 2026 15:30:02
    Am 30.09.26 um 14:50 schrieb Chris Green:
    I don't think setting /etc/hostname to the FQDN is correct as, if you do that, then 'hostname' returns the FQDN and it should only return the
    host's name without the domain.

    I did it that way (FQDN in /etc/hostname), as some milters required me
    to do so.

    hostname -s give you the short name without the domain, -d gives the
    domain name.

    --
    Gruá
    Marco

    Spam bitte an abfalleimer2001@stinkedores.dorfdsl.de

    --- PyGate Linux v1.5.19
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)