Joined: 07 Jan 2011
|Posted: Fri Aug 02, 2019 15:49 Post subject: ignore dns from dhcp / use static dns only
|I haven't been able to find a way to keep my ISP's dns servers out of /tmp/resolv.dnsmasq
It looks like I could fix this by replacing the /tmp/udhcp script, called by udhcp to configure the network, with a wrapper that unsets the dns environment variable. Then the upstream dns information would not be used.
For dhcp6c it would be simpler, set a custom configuration without request domain-name-servers;
Is this a good way to disable dhcp-provide DNS? Thanks.
I put Python on usb storage, added `/opt/bin/udhcpc` as
import os, sys
os.execve('/sbin/rc', ['udhcpc'] + sys.argv[1:], os.environ)
and added `ln -sf /opt/bin/udhcpc /tmp/udhcpc` to my startup script.