On a ipv6 only server I want to temporary activate another nameserver who offers DNS64/NAT64 to bridge connections to ipv4 addresses.
I only need this connection to backup a SVN repository from svn.code.sf.net for which unfortunately no aaaa record exists (why?!!)
I solved the issue by changing the content of /etc/resolv.conf from within the shellscript that does the backup job. After the download it changes the nameserver entries back to the normal configuration.
It runs now with a “sleep 10” after the change which succeeded in all my tests. But I would prefer to signal the new values to the responsible daemon.
Will that be the NetworkManager.service? Or what is the best method for my demand?
Yes, that is usually the way; NetworkManager manages the /etc/resolv.conf
NetworkManager can be configured to not touch the /etc/resolv.conf, but then one needs some other way to manage it.
Note though that the /etc/nsswitch.conf has probably files dns for hosts. That is, the name resolution reads first /etc/hosts and after that uses the resolver (if necessary). The /etc/hosts has by default only the localhost (127.0.0.1 and ::1). You could have that one “AAAA” in there, if only this host needs that one (static) address.
I thought about that before implementing the change of /etc/resolv.conf, but I suppose the NAT64 service which I use as bridge to IPv4 creates the fake IPv6 address on demand. So it will only be there for the while where I call the connection via the DNS64 service.
Done and works like a charm! Thanks again for pointing me to this improved method!
Create a new connection with settings from Hetzners default
# nmcli con clone 'System eth0' nat64
System eth0 (5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03) cloned as nat64 (4ca97012-e022-4572-bac6-14e6c318dc72).
Modify new connection to use DNS64/NAT64 from “Public NAT64 service” (https://www.nat64.net/) # nmcli con mod nat64 ipv6.dns '2a00:1098:2c::1,2a01:4f8:c2c:123f::1,2a00:1098:2b::1' connection.autoconnect no
Switch to new connection
# nmcli -p con up nat64 ifname eth0
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/7)
Switch back to default
# nmcli -p con up 'System eth0' ifname eth0
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/8)
Now you have two connections for that one interface. If you did clone all settings, then both have connection.autoconnect: yes. Which one do you expect to take over when the system boots?
Perhaps this “temporary” connection should not try to activate on boot? connection.autoconnect: no
Alternatively, tune the connection.autoconnect-priority of them to make the regular “win”.