To disable the DNS server in the ifcfg config file, you can follow these steps:

  1. Open the ifcfg config file for the specific network interface using a text editor. The location of the file may vary depending on your Linux distribution, but it is generally found in the /etc/sysconfig/network-scripts/ directory.

  2. Locate the line that starts with DNS1= or DNS=. This line specifies the primary DNS server.

  3. Comment out or remove the line by adding a # at the beginning of the line or deleting it completely. This will disable the primary DNS server.

  4. If there is a line for the secondary DNS server (e.g., DNS2=), comment it out or remove it as well.

  5. Save the changes and exit the text editor.

  6. Restart the network service to apply the changes. The command to restart the network service may vary depending on your Linux distribution, but it is commonly sudo systemctl restart network or sudo service network restart.

By following these steps, the DNS server will be disabled for the specific network interface configured in the ifcfg file

how to disable dns server in ifcfg config file

原文地址: http://www.cveoy.top/t/topic/iU3w 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录