Article 53473 remove nameserver line from resolv.conf

remove nameserver line from resolv.conf

by
ddenial
from LinuxQuestions.org on (#53473)
Hello All,

Following is an output of resolv.conf from CentOS 7.8 KVM guest.
Code:# cat /etc/resolv.conf
# Generated by NetworkManager
search kvmlab.lan cntnix.lan
nameserver 192.168.122.1
nameserver 192.168.1.7I want to remove the line 'nameserver 192.168.122.1'. I don't know from where it is appending. I have not mentioned it anywhere.

This is my network config file
Code:# cat /etc/sysconfig/network-scripts/ifcfg-enp1s0
TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="dhcp"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="enp1s0"
DEVICE="enp1s0"
ONBOOT="yes"
DOMAIN="kvmlab.lan cntnix.lan"
DNS1=192.168.1.7How do I remove that nameserver from libvirt (192.168.122.1)?

Thankslatest?d=yIl2AUoC8zA latest?i=1quvnvdWy8U:lIAXXc4BUxo:F7zBnMy latest?i=1quvnvdWy8U:lIAXXc4BUxo:V_sGLiP latest?d=qj6IDK7rITs latest?i=1quvnvdWy8U:lIAXXc4BUxo:gIN9vFw1quvnvdWy8U
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments