Linux temporary or permanent DNS modification recently reinstalls the system for VPS. because the service provider does not provide DHCP, you have to manually set the IP address and DNSServer. Sadly, when the system was reinstalled, it forgot to input DNSServer. finally, after entering the system, various domain names could not be resolved. In Linux, DNS modification involves temporary or permanent DNS modification. recently, the system has been reinstalled for VPS. because the service provider does not provide DHCP, you have to manually set the IP address and DNS Server. Sadly, when the system was reinstalled, it forgot to enter the DNS Server. finally, after entering the system, various domain names could not be resolved. There are two ways to modify DNS in Linux: temporary modification and permanent modification. 1. temporarily modify the Nic DNS address sudo vim/etc/resolv. change the conf file to the following content: nameserver 8.8.8.8 # change it to your primary DNSnameserver 8.8.8.4.4 # change it to your backup DNSsearch localhost # your domain name I used Google's DNS resolution server here. after modification: if wq exits, the configuration will take effect in real time, but the configuration may be lost after the system is restarted. In fact, when editing this file, you should also be able to see the comment "do not manually edit" in the file header. 2. permanently modify the Nic DNS sudo-icd/etc/resolvconf/resolv. conf. dvim base to add the following content: nameserver 8.8.8.8nameserver 8.8.4.4: wq save and exit, so that the settings will not be lost after restart. In fact, your cat head file will find the comments in the image's header, which is not hard to guess resolv. the conf file is based on/etc/resolvconf/resolv. conf. d directory.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.