Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-21-2012, 04:49 AM
|
#1
|
|
Member
Registered: Aug 2012
Location: Australia
Distribution: Redhat, CentOS
Posts: 46
Rep: 
|
DNS entry vanishes after restart
Dear experts,
I had configured my system for static IP, GATEWAY and DNS. I put gateway entry in;
"/ets/sysconfig/network.conf"
and DNS entry in;
"/etc/resolve.conf"
"ifcfg-em1" only contains my IP and subnet mask.
the problem is that my system resolves names properly but everytime it restarts, ,my nameserver entry from resolve.conf is removed and I need to re-enter my dns entry which sounds weird.
Quote:
[root@localhost ~]# vi /etc/resolv.conf
# Generated by NetworkManager
# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
~
~
~
"/etc/resolv.conf" 9L, 228C
|
how to overcome this issue, please.
|
|
|
|
12-21-2012, 04:54 AM
|
#2
|
|
Senior Member
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,856
|
Which dhcp client does your system use? When you use dhcpcd with a static IP, you will have to add "nohook.resolv.conf" to the /etc/dhcpcd.conf file.
When you use another dhcp client, read the manpage.
Markus
|
|
|
|
12-21-2012, 05:00 AM
|
#3
|
|
Member
Registered: Aug 2012
Location: Australia
Distribution: Redhat, CentOS
Posts: 46
Original Poster
Rep: 
|
Brother,
how would i find that out :S
I am using CentOS.
|
|
|
|
12-21-2012, 05:05 AM
|
#4
|
|
Senior Member
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,856
|
Execute find out if dhcpcd is installed and if it's not find out which program is used instead.
Afterwards read it's manpage.
Markus
|
|
|
|
12-21-2012, 05:05 AM
|
#5
|
|
Member
Registered: Mar 2009
Posts: 143
Rep:
|
If you are using static ips, disable network manager.
|
|
|
|
12-21-2012, 05:09 AM
|
#6
|
|
Member
Registered: Aug 2012
Location: Australia
Distribution: Redhat, CentOS
Posts: 46
Original Poster
Rep: 
|
Quote:
Originally Posted by markush
Execute find out if dhcpcd is installed and if it's not find out which program is used instead.
Afterwards read it's manpage.
Markus
|
That is what I get;
Quote:
[root@localhost ~]# apropos dhcp
dhclient-script (8) - DHCP client network configuration script
dhclient.conf [dhclient] (5) - DHCP client configuration file
dhclient.leases [dhclient] (5) - DHCP client lease database
dhcp-eval (5) - ISC DHCP conditional evaluation
dhcp-options (5) - Dynamic Host Configuration Protocol options
dhcpc_selinux (8) - Security Enhanced Linux Policy for the dhcpc processes
dhcpd_selinux (8) - Security Enhanced Linux Policy for the dhcpd processes
dnsmasq (8) - A lightweight DHCP and caching DNS server
kpac_dhcp_helper (7) - provides Proxy Auto Configuration to KDE
|
|
|
|
|
12-21-2012, 05:11 AM
|
#7
|
|
Member
Registered: Aug 2012
Location: Australia
Distribution: Redhat, CentOS
Posts: 46
Original Poster
Rep: 
|
Quote:
Originally Posted by bradvan
If you are using static ips, disable network manager.
|
brother from where I am gona disable it?
|
|
|
|
12-21-2012, 05:12 AM
|
#8
|
|
Senior Member
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,856
|
Well it's dhclient, read the manpage for dhclient and dhclient.conf
Markus
|
|
|
|
12-21-2012, 05:15 AM
|
#9
|
|
Senior Member
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,856
|
Quote:
Originally Posted by sudo_su
brother from where I am gona disable it?
|
Well, this depends on your distribution, I would google for "centos static ip" or "centos networkmanager" ...... and find this http://www.centos.org/docs/5/html/De...nterfaces.html
Markus
|
|
|
|
01-04-2013, 05:41 AM
|
#10
|
|
Member
Registered: Mar 2009
Posts: 143
Rep:
|
Sorry, I was away for the Christmas break.
First, cd /etc/sysconfig/network-scripts then:
Code:
for f in ifcfg-eth?; do
if [ $(grep -c 'NM_CONTROLLED="yes"' ${f}) -gt 0 ]; then
echo "Modifying the ${f} script to disable network manager."
sed -i 's/^\(NM_CONTROLLED="\)yes.*/\1no"/' ${f}
fi
if [ $(grep -c "^DNS" ${f}) -gt 0 ]; then
echo "Deleting the dns resolver entries from ${f}."
sed -i '/^DNS/d' ${f}
fi
done
Make sure your /etc/resolv.conf is set up correctly. Then do:
Code:
rpm -e NetworkManager-gnome NetworkManager-glib NetworkManager
That should get rid of Network Manager. 
|
|
|
|
01-06-2013, 08:07 PM
|
#11
|
|
Guru
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.4, Centos 5.9
Posts: 15,021
|
If you just want to disable it on a per NIC basis
Code:
cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
HWADDR="E0:CB:4E:B9:5F:1A"
NM_CONTROLLED="no"
ONBOOT="yes"
BOOTPROTO="dhcp"
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:09 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|