Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
can anybody tell me how to change the DNS in Mandriva Linux.
I tried to change it from the file
Code:
/etc/resolv.conf
but the thing is that when I restarted the network after the configuration the DNS was again rolled back to the previous setting.
How can I change the setting permanently.
But the code snippet presented over there is quite different from mine. In my machine it looks like the following:
Code:
make_resolv_conf() {
local d
local ns
if [ -n "$DOMAIN" ]; then
d="search $DOMAIN"
fi
if [ x"$new_domain_name_servers" != x ]; then
if [ -n "$DOMAIN" ]; then
# already done above
d="search $DOMAIN"
elif [ x"$new_domain_search" != x ]; then
d="search $new_domain_search"
elif [ x"$new_domain_name" != x ]; then
# Note that the DHCP 'Domain Name Option' is really just a domain
# name, and that this practice of using the domain name option as
# a search path is both nonstandard and deprecated.
d="search $new_domain_name"
fi
for nameserver in $new_domain_name_servers; do
ns="$ns"$'\n'"nameserver ${nameserver}"
done
elif [ "x${new_dhcp6_name_servers}" != x ] ; then
if [ -n "$DOMAIN" ]; then
# already done above
d="search $DOMAIN"
elif [ "x${new_dhcp6_domain_search}" != x ] ; then
d="search ${new_dhcp6_domain_search}"
fi
for nameserver in ${new_dhcp6_name_servers} ; do
ns="$ns"$'\n'"nameserver ${nameserver}"
done
fi
if [ -n "$d" -o -n "$ns" ]; then
change_resolv_conf "$d" "$ns"
fi
}
Now the thing is that I use DHCP for my network configuration and I want to change the DNS. I try to change it in /etc/resolv.conf but the change is not reflected when I reboot.
How can I change the script.
By default, I think DHCP automatically detects the DNS addresses and updates resolv.conf. I've seen settings to disable this, but I don't know where it shows up in config files.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.