LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   /etc/resolv.conf problem (https://www.linuxquestions.org/questions/linux-newbie-8/etc-resolv-conf-problem-4175519729/)

redwhat 09-22-2014 11:54 AM

/etc/resolv.conf problem
 
hi

i have error from selinux
i put the nameserver of 208.67.222.222 [opendns]
now i have some problem with,
i don't remember that default setting in /etc/resolv.conf
some 1 can tell me what they are?

netnix99 09-22-2014 01:15 PM

It should typically just be two lines:

search mydomainname.com
nameserver IP_of_DNS_Server

If you are using DHCP, and have all of the associated fields pre-defined in the DHCP configuration, Network Manager will automatically create and update this file, simply restart your network services and it will be reverted back to the settings contained in the DHCP SEerver configuration.

redwhat 09-23-2014 01:28 AM

1sec..

i have problem with selinux :

SELinux is preventing /usr/sbin/NetworkManager from unlink access on the file .

i really want to keep dns of opendns what i can do about this >?

this is my /etc/resolv.conf :

# Generated by NetworkManager
nameserver 208.67.222.222 + 208.67.220.220


i try before this :
# Generated by NetworkManager
nameserver 208.67.222.222
nameserver 208.67.220.220


but it still give me error in Selinux

netnix99 09-23-2014 07:35 AM

I will assume you are using DHCP. If so, you can edit /etc/dhclient.conf and insert the line:
Code:


supersede domain-name-servers 208.67.222.222, 208.67.222.222;

This will cause NetworkManager to rewrite the /etc/resolv.conf file with the new information.

jpollard 09-23-2014 07:39 AM

Try a "restorecon /etc/resolv.conf"

The security label is likely incorrect. The above command will restore the security context for the file.

redwhat 09-24-2014 01:46 AM

netnix99 thank you it seems to work
jpollard thank you too.


All times are GMT -5. The time now is 10:06 AM.