Arnoud Otten([email protected]) on 2021.10.30 22:18:09 +0200:
> Hi,
> 
> Maybe i am wrong and do not understand this right, but wat should  the 
> ???ignore dns??? option do when used in the dhcpleased .conf config file?
> Here @xs4all our IPTV network on a separate vlan also gets an ip address and 
> the dhcp offer also sends a dns server which should be ignored. 
> I also thought that with the ???ignore dns??? option, this dns server was 
> blocked, but that is not what the option does? 
> 
> Regards,
> 
> Arnoud

The "ignore dns" config option causes dhcpleased to send a RTM_PROPOSAL
message to resolvd with an empty DNS proposal for that interface. This
causes resolvd to remove any nameserver entry for that interface from
/etc/resolv.conf.

Note that resolvd adds comments to the lines it touches in resolv.conf, for
example:
nameserver 192.168.1.1 # resolvd: iwm0

Anyone who thinks the "ignore dns" option does not work could help to debug
this with the following:

* run "route -n monitor"
* empty the dhcpleased.conf: mv /etc/dhcpleased.conf /etc/X.dhcpleased.conf
* cat /etc/resolv.conf, copy the output into an email.
* restart dhcpleased: doas /etc/rc.d/dhcpleased restart 
* copy the output of "route -n monitor" into the email
* cat /etc/resolv.conf, copy the output into the email.

then run dhcpleased with the configuration file:

* run "route -n monitor"
* mv /etc/X.dhcpleased.conf /etc/dhcpleased.conf
* cat /etc/dhcpleased.conf and copy the output into the email
* cat /etc/resolv.conf, copy the output into the email.
* restart dhcpleased: doas /etc/rc.d/dhcpleased restart
* copy the output of "route -n monitor" into the email
* cat /etc/resolv.conf, copy the output into the email.

send that email as a reply to this thread.

Thanks,
Benno

> > On 30 Oct 2021, at 21:00, Sebastian Benoit <[email protected]> wrote:
> > 
> > ???Z?? Loff([email protected]) on 2021.10.29 18:30:29 +0100:
> >>> On Fri, Oct 29, 2021 at 03:37:56PM +0300, Samarul Meu wrote:
> >>> Hello to you all!
> >>> 
> >>> Prior to 7.0 I was using this line in /etc/dhclient.conf
> >>> supersede domain-name-servers 127.0.0.1;
> >>> so that I do not get the DNS from the ISP provider.
> >>> 
> >>> I am using unbound to resolve my queries. With the new changes I can not
> >>> get the same functionality.
> >>> 
> >>> I tried to add this in /etc/dhcpleased.conf
> >>> interface urtwn0 ignore dns
> >>> where urtwn0 is my interface or disable resolvd.
> >>> 
> >>> If resolvd is on I get my ISP DNS server, if not when unbound starts
> >>> resolvd  adds the ISP DNS server to resolv.conf.
> >>> 
> >>> Can you please tell me what am I doing wrong and how can I have only
> >>> 127.0.0.1 on the resolv.conf file?
> >>> 
> >>> Thank you!
> >> 
> >> This works for me:
> >> 
> >> 
> >> /etc/hostname.em0:
> >> 
> >>    inet autoconf
> >> 
> >> 
> >> /etc/resolv.conf:
> >> 
> >>    nameserver 127.0.0.1
> >> 
> >> 
> >> /etc/dhcpleased.conf:
> >> 
> >>    interface em0 {
> >>        ignore dns
> >>    }
> > 
> > 
> > If you never intend to use other nameservers on this system, you can also
> > deactivate resolvd:
> > 
> >  rcctl stop resolvd
> >  rcctl disable resolvd
> > 
> > and remove dhcpleased.conf again.
> > 
> > 
> 

-- 

Reply via email to