Record of how to configure permanent DNS in Ubuntu system environment

888u

Last update at :2024-06-16,Edit by888u

When I helped a netizen install the Oneinstack script on the Linode machine he opened yesterday, it prompted that the official source program could not be downloaded. There is no problem with the server. PING and SSH login are normal. It seems that there is a problem with the DNS that comes with the system and needs to be replaced to solve the problem. Here Snail records the solution to modify DNS.

First, temporary solution

vi /etc/resolv.conf

If we have a temporary solution, just replace the nameserver inside with:

nameserver 8.8.8.8

nameserver 8.8.4.4

Then save and exit. But in this way, if the server is restarted, it will be restored. It is not permanently modified. What we need to do is to permanently modify it.

Second, permanently modify DNS

In this article, this friend’s system is Ubuntu system.

apt-get install resolvconf

Install resolvconf.

vi /etc/resolvconf/resolv.conf.d/base

Add to the file:

nameserver 8.8.8.8nameserver 8.8.4.4

Save and exit.

resolvconf -u

Restart DNS. Or we restart the server. After it takes effect, we will try again to see if it can be downloaded.

Recommended site searches: domain name query official website, high-defense server rental, this website server in the United States, US server, private server rental, high-defense US server, website space rental, domain name query, cloud server for 6 yuan per year, < /p>

Record of how to configure permanent DNS in Ubuntu system environment

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码