I have a tunnel that I need to be able to tie to one of several local interfaces each of which has a dynamic IP, depending which Internet provider is performing best. I had been setting a local DNS e.g. "openvpn.local" to the address of the interface and then in the openvpn conf file, I use "local openvpn.local" which works - except when the system first starts up. At boot time, it can't resolve the address and exits with fatal error. I have tried forcing bind9 to start before openvpn using After= and Wants=bind9.service both in /etc/systemd/system/openvpn.service and openvpn@.service and the dependency is properly listed and bind9 now is starting before openvpn. However the name still is not being resolved during the boot sequence. Once the system is up, I can run systemctl start
openvpn@configfilename.service and it comes up fine.
Any ideas on what would be stopping name resolution at boot time?