Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep both IPv4 and IPv6 DNS server (provided by dhcp server) addresses in /etc/resolv.conf #251

Open
evergtreen opened this issue Apr 1, 2019 · 0 comments

Comments

@evergtreen
Copy link

In one scenario, users adopt both IPv4 and IPv6, and devices get addresses from IPv4 and IPv6 dhcp servers, respectively.
In addition, each dhcp servcer provides its own DNS option. For example, the DNS server provied by IPv4 dhcp server is 2.2.2.2, while the DNS server obtained from IPv6 dhcp server is FCD0::2. However, the /etc/resolv.conf file only keeps one DNS server address from IPv4 or IPv6 dhcp server, which will result in the failure to resolve another protocol domain name.

In /etc/sysconfig/network-scripts/network-functions file, the /etc/resolv.conf will be rewritten by change_resolv_conf func rather than appending new dns server to the file as follows,

533 # Invoke this when /etc/resolv.conf has changed:
534 change_resolv_conf ()
535 {
		...
538     oldumask=$(umask)
539     umask 022
		...
566        fi;
567     fi;
568     (echo "$s" > /etc/resolv.conf;) >/dev/null 2>&1;
569     r=$?
		...
576     umask $oldumask
577     return $r;
578 }

Is there a good way to keep both DNS server addresses from IPv4 and IPv6 dhcp servers at the same time? Finally, users can obtain the available /etc/resolv.conf as follows,
#cat /etc/resolv.conf
nameserver 2.2.2.2
nameserver fcd0::2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant