Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoreDNS support for PFSsense #1323

Open
wants to merge 3 commits into
base: devel
Choose a base branch
from

Conversation

tvdv
Copy link

@tvdv tvdv commented Nov 15, 2023

This PR adds basic CoreDNS support to pfSense

CoreDNS is useful on pfSense for custom/complex DNS configurations (e.g. split-DNS).

Here is an example CoreDNS configuration that will use a different forwarder, based on client IP. This example implements cloud-flare's family DNS blocking for some clients(192.168.2.0/24) and not others (192.168.1.0/24).

. {
  view familyfriendly {
    expr incidr(client_ip(), '192.168.2.0/24')
  }
  hosts /etc/hosts {
    1.1.1.3 testname 
    fallthrough
 }
 forward . tls://1.1.1.3 tls://1.0.0.3 {
    tls_servername family.cloudflare-dns.com
    policy random
    health_check 50s
 }
}

. {
  view default {
    expr incidr(client_ip(), '192.168.1.0/24')
  }
  hosts /etc/hosts {
    1.1.1.1 testname 
    fallthrough
 }
 forward . tls://1.1.1.1 tls://1.0.0.1 {
    tls_servername cloudflare-dns.com
    policy random
    health_check 50s
 }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant