[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to change default nameserver?



On 4/9/23 04:20, coreyh@free.fr wrote:
greetings,

I know I can edit the entries in /etc/resolv.conf, but it will be overwritten by DHCP server.
I searched the internet and got one of the answers:

apt install resolvconf
echo "nameserver 127.0.0.1" >> /etc/resolvconf/resolv.conf.d/head

what's the difference for /etc/resolv.conf and the method above?

I'm not sure, and my methods have been heavily denegrated by the dhcp fans, but in my case with a many machine local net, and no dhcpd running on the system, and the changes with each new release, I find the one repeatable method to solve dns problem, is to compose an /etc/resolv.conf with 2 lines:

mameserver ipv4 address of router
search hosts, nameserver

And sudo chattr +i /etc/resolv.conf

quickly so NM can't change it. It will remove the search line, killing your local network, in which case you can ping yahoo.com, but not another machine on your local net. Your ISP's dns has no knowledge of your local net which is as it should be.

My router runs something like dnsmasq as its running dd-wrt, and theoretically a dns request then searchs the host file for a matching name, failing that my whole local system then query's the router, which if not cached by dnsmasq, sends the query on to my ISP's dns server, and I get answers in around 30 milliseconds. And it all just works. With the router NAT-ing, all machines here can browse the whole planet, as transparently as border facilities allow.

My main problem with each new release is the ever changing methods of establishing each machines repeatable, permanent, name and local address on a completely static system described in the /etc/hosts file. Reliably setting a domainname used to be once and done, but since bullseye its only for this reboot, but I've not found a place to make it permanent across reboots, yet...

If anyone knows how to do that on bullseye, I'm all ears. Hopefully it will continue to work with bookworm but I'm not a betting man. I'm still looking for a way to re-establish cups printer sharing, which Just Worked with buster, but is now blocked on bullseye from other bullseye machines, but still works with buster machines to this bullseye machine. WTH???

Thanks for reading, take care and stay well, all.

Thanks & Happy weekend.
corey hickman

.

Cheers, Gene Heskett.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/>


Reply to: