IPv6 only adventures
I recently wanted to get a project up and running quite quickly and cheaply, so I opted to go for a server over at Hetzner. They are great providers of affordable dedicated servers. I also saw they charge for IPv4 addresses to dissuade people from using them and move on to IPv6, which I strongly support. So I went ahead with just a IPv6 public address. That is when the adventure started.
Github.com
So it is 2026 as I write this post and still GitHub.com does not have a AAAA record resolving to a public IPv6 address. This means if you are on a server, like the one I got, that only has IPv6 egress networking capabilities, then you are screwed. Since you cannot connect over IPv4 to any service. Luckily for us there exists a very nice service that resolves to public NAT addresses for IPv4 only services like GitHub. So that was solved.
Every other process
So two problems why networks fail, are either it is DNS or it is BGP. Well in my case it is DNS. The problem is that by default systemd-resolved runs on local loopback 127.0.0.1 which is IPv4. That got settled quickly with just running the following config in /etc/system/resolved.conf.d/ipv6.conf:
[Resolve]
DNS=2a00:1098:2c::1 2a01:4f8:c2c:123f::1 2a00:1098:2b::1
FallbackDNS=2a01:4ff:ff00::add:2 2a01:4ff:ff00::add:1
#Domains=
#DNSSEC=no
#DNSOverTLS=no
#MulticastDNS=no
#LLMNR=no
#Cache=no-negative
#CacheFromLocalhost=no
DNSStubListener=no
DNSStubListenerExtra=[::1]:53
#ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no
#StaleRetentionSec=0
This will run the process listening only on the local loopback IPv6 address. However it still resolves A records if you ask it to of course.
The actual problem I ran into was that a Node instance wanting to send mails with nodemailer resolved the service I was using to an IPv4 address.
I tried to give the --dns-result-order=ipv6first to the node process but that did nothing, even though my test code within that loaded instance resolved the IPv6 address. Well the culprit is actually nodemailer itself. It just always resolves the IPv4 address first and if it got an address then it went with that. This was version 6 however and they are at version 8 nowadays. So I looked at the latest code and it does combine the addresses in total, but does not respect the option you gave to Node for what to do first.
I just hacked the code to resolve only IPv6 addresses and it was “solved”.
Problem not solved
The problem was not really solved because there is still no way to give to every process only IPv6 addresses by default. You can edit the /etc/gai.conf file. Then you need to have IPv6 addresses for your DNS servers only and then you still need to potentially configure NetworkManager to prefer IPv6 first. Even so, after all that work, every language has libraries and implementations that let's you bypass that.
Like we saw with nodemailer and NodeJS. It is nigh impossible to have an IPv6 only setup in the real world, rather than in just a homelab situation where you control everything.