Cloudflare for a select few DHCP clients

There are a few dozen DHCP clients behind this campus IPFire network.
Some have fixed leases like servers, etc.

They want IPFire to use the ISP-assigned DNS server as much as possible. It is the default.

How do you make a IPFire assign Cloudflare as the DNS for a select group of 8 DHCP clients?
And leave the rest of the DHCP clients as is - IPFire as their DNS.

Don’t see anything in the WUI page to do this.

I am not aware of a way to do this in IPFire. You could set the DNS on those select few DHCP clients to Cloudflare, then have IPFire manage DNS for the rest with the ISP default.

Yeah, we are already doing that on a few DHCP clients.
But on some devices we have to change them from dynamic to static IP addresses, in order to specify (Cloudflare as) the non-default DNS. That involves managing address blocks in an ad hoc manner. It is easier to do it all within IPFire.

:thinking:
edit
I wonder if the file /var/ipfire/dhcp/dhcpd.conf.local can be used for this purpose.

It is possible to redirect clients to use IPFire’s DNS:

Similarly, you can create a client group with a DNS redirect from IPFire to Cloudflare.

However, the DNS server displayed to the client will still be IPFire.

1 Like

I am aware of and use the firewall rule to redirect DNS to IPFire for all users. What I meant was I was not aware of splitting this up so that some clients fall under this rule while other clients use whatever other DNS they want.

:thinking: What if, in this case, we added the rule above redirecting to another DNS server?

Here’s the test I performed for this use case:

DNS Page


Services Group

Hosts Group

Rules

Rule2

Rule3

IncomingRule1

OutgoingRule1

I verified this with Tcpdump

virtual10 accesses CloudFlare’s DNS via IPFire’s redirection
Virtual11 accesses IPFire’s (Google) DNS

2 Likes

edit

Probably if we do not use Force clients to use IPFire DNS Server, we can move (to the dhcpd.conf.local file) the configuration of the client’s static lease by adding option domain-name-servers.

e.g.

host fix0 # debiantest
{
	hardware ethernet AA:BB:CC:DD:EE:FF;
	fixed-address 10.10.10.100;
	option domain-name-servers 1.1.1.1, 8.8.8.8;
}
3 Likes

Yes, it works fine without using IPFire’s DNS.
It’s in the file /var/ipfire/dhcp/dhcpd.conf.local (not dhcpd.local.conf) :wink:
You also need to remove the added entry from the dhcp.cgi page.

1 Like

Oops :face_with_open_eyes_and_hand_over_mouth:
You’re absolutely right. :smiley:
I have made the necessary corrections.