I'm trying to update my dns servers after openvpn connection, but netconfig won't do that for me.
Here's how I'm trying to do it [manually now]:
/sbin/netconfig modify -v -i tap0 -s openvpn <<-EOF
INTERFACE='tap0'
DNSSERVERS='10.10.0.1'
EOF
And here's the verbose output:
debug: lockfile created (/var/run/netconfig.pid) for PID 5530
debug: lockfile created
debug: write new STATE file /var/run/netconfig//tap0/netconfig0
debug: Module order: dns-resolver dns-bind dns-dnsmasq nis ntp-runtime
debug: dns-resolver module called
debug: Static Fallback
debug: Use NetworkManager policy merged settings
debug: exec get_dns_settings: /var/run/netconfig/NetworkManager.netconfig
debug: get_dns_settings: service 'NetworkManager' => rank '1'
debug: get_dns_settings: DNS_SEARCHLIST_1='mydomain.com'
debug: get_dns_settings: DNS_SERVERS_1='192.168.0.1'
debug: exit get_dns_settings: /var/run/netconfig/NetworkManager.netconfig
debug: write_resolv_conf: ' mydomain.com ' ' 192.168.0.1 '
debug: No changes for /etc/resolv.conf
debug: dns-bind Module called
debug: dns-dnsmasq Module called
debug: nis Module called
debug: Static Fallback
debug: Use NetworkManager policy merged settings
debug: exec get_nis_settings: /var/run/netconfig/NetworkManager.netconfig
debug: exit get_nis_settings: /var/run/netconfig/NetworkManager.netconfig
debug: set_nisdomainname: eth0 24
debug: set_nisdomainname: => yes
debug: set_nisdomainname: old[]=, new[24]=
debug: format_yp_conf called with :
debug: Using static fallback
debug: format_static[0] called
debug: No changes for /etc/yp.conf
debug: nis domainname '' is up to date
debug: ntp-runtime Module called
debug: Static Fallback
debug: Use NetworkManager policy merged settings
debug: exec get_ntp_settings: /var/run/netconfig/NetworkManager.netconfig
debug: get_ntp_settings: NTP_SERVER_LIST=''
debug: exit get_ntp_settings: /var/run/netconfig/NetworkManager.netconfig
I've been trying to find something relevant on the web, but failed to do so. I have no other clue on how to progress with this issue.
Any thoughts?
The relevant configuration is in
/etc/sysconfig/network/config
.When NetworkManager is enabled (
NETWORKMANAGER="yes"
), as it seems to be in your case, the default DNS update policytranslates to
as outlined in the netconfig(8) man page. This means the static DNS addresses are included, followed by the ones provided by NetworkManager.
The information you provide manually via
netconfig modify
is considered fromtap0
and so isn't included.To have your information included, you need to set
where the
*
wildcard matches dynamic information from any interface, or you could be more specificnote that any policies after NetworkManager are ignored because of the way
/etc/netconfig.d/dns-resolver
is written.