• Re: ipv6 dns-nameservers

    From Henrik Ahlgren@21:1/5 to Mal on Thu Mar 27 09:00:01 2025
    Mal <malz@jetlan.com> writes:

    On Debian 6.1.129-1, I have a static network interface conf (no Netplan)
    with both IPv4 & IPv6 addressing and Name-servers set.

    [...]

    On another older machine (running kernel 4.9.35-v7+) with exactly the
    same configuration layout, I get BOTH the IPv4 & IPv6 addresses returned
    from resolv.conf

    Unfortunately, I am unsure what the issue is. However, I would like to
    point out that Debian version numbers differ from the kernel version,
    which is merely one component of the system. Please refer to /etc/debian_version and /etc/os-release to determine the version of the distribution you are running.

    The current kernel version for Debian 12, codename "bookworm", is
    6.1.129-1. The 4.9 kernel was in Debian 9 "stretch", which is quite
    outdated, and many relevant components have been updated since, so even
    with "exactly the same configuration layout", you can expect different behaviour.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From basti@21:1/5 to All on Thu Mar 27 08:30:01 2025
    Hello,

    first of all the nameservers in /etc/resolv.conf are queried in order.
    That means the 2'nd one is only queried when the first one does not
    answer. Even NXDOMAIN is a valid answer.
    So the first one should also return IPv6 over a IPv4 connection.

    How do you query the nameserver? dig, 'getent hosts' ... ?


    Am 27.03.25 um 05:04 schrieb Mal:
    Hello

    On Debian 6.1.129-1, I have a static network interface conf (no Netplan)
    with both IPv4 & IPv6 addressing and Name-servers set.


    root@debian:/home/user# more /etc/network/interfaces
    source /etc/network/interfaces.d/*
    # The loopback network interface
     auto lo
     iface lo inet loopback

     allow-hotplug enp1s0
     iface enp1s0 inet static
     address 12.34.56.78
     network 12.34.56.0
     netmask 255.255.255.0
     broadcast 12.34.56.255
     gateway 12.34.56.1

     iface enp1s0 inet6 static
     address 2xxx:xxxx:x00:1::50
     netmask 64
     gateway 2xxx:xxxx:x00:1::1
     dns-nameservers 12.34.56.80  2xxx:xxx:x00:1::80


    When I query what is set in resolv.conf file, It only returns the IPv4 host.

    root@debian:/home/user# more /etc/resolv.conf
    nameserver 12.34.56.80

    On another older machine (running kernel 4.9.35-v7+) with exactly the
    same configuration layout, I get BOTH the IPv4 & IPv6 addresses returned
    from resolv.conf

    root@another:/home/user# more /etc/resolv.conf
    nameserver 12.34.56.80
    nameserver 2xxx:xxx:x00:1::80


    The IPv6 networking side has no issues - I can ssh over to other
    machines via IPv6 with no issues.  And the machine is serving v6 web
    traffic fine.

    Mal



    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Smith@21:1/5 to Mal on Thu Mar 27 11:50:02 2025
    Hi,

    On Thu, Mar 27, 2025 at 02:34:13PM +1030, Mal wrote:
    On Debian 6.1.129-1, I have a static network interface conf (no Netplan)
    with both IPv4 & IPv6 addressing and Name-servers set.

    I don't know why only your IPv4 address is making it into resolv.conf,
    but if the network setup is static then I would (and do) just put both
    into resolv.conf manually rather than use resolvconf package - this is
    what the dns-nameservers configuration is talking to.

    If you want to debug it further, resolvconf will install something in /etc/network/interfaces.d which looks for these dns-nameservers settings
    in order to update the file, so have a look what they do.

    Thanks,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Mal on Thu Mar 27 12:00:01 2025
    On Thu, Mar 27, 2025 at 14:34:13 +1030, Mal wrote:
    root@debian:/home/user# more /etc/network/interfaces
    source /etc/network/interfaces.d/*
    # The loopback network interface
     auto lo
     iface lo inet loopback

     allow-hotplug enp1s0
     iface enp1s0 inet static
     address 12.34.56.78
     network 12.34.56.0
     netmask 255.255.255.0
     broadcast 12.34.56.255
     gateway 12.34.56.1

     iface enp1s0 inet6 static
     address 2xxx:xxxx:x00:1::50
     netmask 64
     gateway 2xxx:xxxx:x00:1::1
     dns-nameservers 12.34.56.80  2xxx:xxx:x00:1::80

    That dns-nameservers line is only used if you're running the "resolvconf" package.

    When I query what is set in resolv.conf file, It only returns the IPv4 host.

    root@debian:/home/user# more /etc/resolv.conf
    nameserver 12.34.56.80

    I would look at the timestamp on that file. Is it being updated at all?

    Next, I would verify that you've installed the resolvconf package, since
    your configuration is relying on it. Or, as another person suggested
    already, skip the resolvconf package entirely, and just use a static resolv.conf file.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Mal on Thu Mar 27 13:10:01 2025
    On Thu, Mar 27, 2025 at 21:38:02 +1030, Mal wrote:
    Without the conf package, I still don't get why it populated only one
    ipv4 nameserver target and ignored the ipv6 target.

    You're making an assumption. All you actually know is what was in the
    file; you don't know HOW it got there. (Or when.)

    The contents of that file might have been generated at any time in
    the past, by anyone or anything.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Smith@21:1/5 to Mal on Thu Mar 27 14:10:01 2025
    Hi,

    On Thu, Mar 27, 2025 at 09:38:02PM +1030, Mal wrote:
    Without the conf package, I still don't get why it populated only one
    ipv4 nameserver target and ignored the ipv6 target.

    Are you sure this is not just what the installation process did?

    Without "resolvconf" the /etc/resolv.conf file is just a static file so
    there's limited things that would be editing it. The guesses of "you"
    or "the installer" would be the most likely for me as nothing else
    should be touching it.

    Thanks,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Andy Smith on Thu Mar 27 14:20:01 2025
    On Thu, Mar 27, 2025 at 13:06:54 +0000, Andy Smith wrote:
    Hi,

    On Thu, Mar 27, 2025 at 09:38:02PM +1030, Mal wrote:
    Without the conf package, I still don't get why it populated only one
    ipv4 nameserver target and ignored the ipv6 target.

    Are you sure this is not just what the installation process did?

    Without "resolvconf" the /etc/resolv.conf file is just a static file so there's limited things that would be editing it. The guesses of "you"
    or "the installer" would be the most likely for me as nothing else
    should be touching it.

    The most common program that writes to resolv.conf is a DHCP client
    daemon (any of them). If the system was originally installed with
    DHCP, and then later changed to static addressing, the resolv.conf
    file might have been written by whichever dhcpcd was installed at
    the time, and then never modified again once the transition to static addressing was made.

    Whoever or whatever wrote the file is irrelevant now, though.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)