Jonathan Billings
2019-Dec-03 13:21 UTC
[CentOS] midco stealling searches, was browsers slowing Centos 7 installation to a crawl
On Mon, Dec 02, 2019 at 06:51:44PM -0600, Michael Hennebry wrote:> I've chacked on that. > I've made what seemed like promissing changes to > /etc/sysconfig/network-scripts/ifup-post and > /etc/sysconfig/network-scripts/network-functions . > No go. > I still get the search line in resolv.conf . > I've tried putting in search google.com , > but on reboot, it still gives me midco and only midco . > > Any idea what does affect search in resolv.conf ? > How can I fix this so I do not have to > manually edit resolv.conf after each reboot.Neither of those files are the correct files to edit. You want to edit the ifcfg-<interface name> file (replace <interface name> with the name of the network interface) and add PEERDNS=no in the file. This will make it so DHCP doesn't overwrite the resolv.conf. If you just want to hard-code DNS servers, you can either do that in your networkmanager configuration, or add DNS1=9.9.9.9 to the ifcfg file. You can add a second IP with DNS2=1.1.1.1, too. Use whatever DNS IPs you want. This is documented in /usr/share/doc/initscripts-*/sysconfig.txt -- Jonathan Billings <billings at negate.org>
Michael Hennebry
2019-Dec-03 19:17 UTC
[CentOS] midco stealling searches, was browsers slowing Centos 7 installation to a crawl
On Tue, 3 Dec 2019, Jonathan Billings wrote:> On Mon, Dec 02, 2019 at 06:51:44PM -0600, Michael Hennebry wrote:>> Any idea what does affect search in resolv.conf ? >> How can I fix this so I do not have to >> manually edit resolv.conf after each reboot. > > Neither of those files are the correct files to edit. > > You want to edit the ifcfg-<interface name> file (replace > <interface name> with the name of the network interface) and add > PEERDNS=no in the file. This will make it so DHCP doesn't overwrite > the resolv.conf.I only have ifcfg-lo , which I am pretty sure is the loopback interface. As expected, other files suggest eth0 is my ethernet connection. Should I add a one-line ifcfg-eth0 file?> If you just want to hard-code DNS servers, you can either do that in > your networkmanager configuration, or add DNS1=9.9.9.9 to the ifcfg > file. You can add a second IP with DNS2=1.1.1.1, too. Use whatever > DNS IPs you want.What I want is to keep midco from hijacking searches. Keeping midco's DHCP from adding a search line to resolv.conf seems to be the key. I'll hard-code DNS servers if I have to, but that is not the point of this. Currently I have # Generated by NetworkManager # search midcoip.net nameserver 2001:48f8:3004:2ce:5a19:f8ff:fe9e:a4bc nameserver 192.168.0.1 My understanding is that the network manager generates resolv.conf and DHCP edits it. Does the network manager include nameservers? Would putting PEERDNS=no in a ifcfg-eth0 file result in an empty resolv.conf ? I realize I could just try it and see, but I do not know how much damage I could do if I mess it up.> This is documented in /usr/share/doc/initscripts-*/sysconfig.txtI have /usr/share/doc/initscripts-9.49.47/sysconfig.txt only. -- Michael hennebry at web.cs.ndsu.NoDak.edu "Sorry but your password must contain an uppercase letter, a number, a haiku, a gang sign, a heiroglyph, and the blood of a virgin." -- someeecards
Jonathan Billings
2019-Dec-03 19:37 UTC
[CentOS] midco stealling searches, was browsers slowing Centos 7 installation to a crawl
On Tue, Dec 03, 2019 at 01:17:53PM -0600, Michael Hennebry wrote:> I only have ifcfg-lo , which I am pretty sure is the loopback interface. > As expected, other files suggest eth0 is my ethernet connection. > Should I add a one-line ifcfg-eth0 file?If you are using ethernet (and not a wireless device or some other internet connectivity) you should have an ifcfg- file for the interface. Look at the output of 'ip link' to see all the interfaces you have configured.> Currently I have > # Generated by NetworkManager > # search midcoip.net > nameserver 2001:48f8:3004:2ce:5a19:f8ff:fe9e:a4bc > nameserver 192.168.0.1 > > My understanding is that the network manager > generates resolv.conf and DHCP edits it. > Does the network manager include nameservers? > Would putting PEERDNS=no in a ifcfg-eth0 file > result in an empty resolv.conf ? > I realize I could just try it and see, > but I do not know how much damage I could do if I mess it up.Since there's no ifcfg file, I suspect you're using NetworkManager to manage your network. Run 'nmcli con' to get a list of your network connections, and then run 'nmcli con edit "Connection Name"' (replace "Connection Name" with the name of your ethernet connection). You can then set ipv4.ignore-auto-dns to 'yes' and then set ipv4.dns and ipv4.dns-search. This should override what DHCP sets.> > This is documented in /usr/share/doc/initscripts-*/sysconfig.txt > > I have /usr/share/doc/initscripts-9.49.47/sysconfig.txt only.I used the * as a glob, not a literal character. -- Jonathan Billings <billings at negate.org>
Seemingly Similar Threads
- midco stealling searches, was browsers slowing Centos 7 installation to a crawl
- midco stealling searches, was browsers slowing Centos 7 installation to a crawl
- midco stealling searches, was browsers slowing Centos 7 installation to a crawl
- midco stealling searches, was browsers slowing Centos 7 installation to a crawl
- midco stealling searches, was browsers slowing Centos 7 installation to a crawl