ioc32 / openhrc

Open Household Router Contraption
Other
13 stars 4 forks source link

Fake authoritative zone responses using unbound #19

Closed ioc32 closed 3 years ago

ioc32 commented 3 years ago

unbound(8) allows the addition of static records via its local-data configuration option.

Move the zone logic to unbound.conf(5) and remove all the now un- needed nsd bits.

We still need to clean up the daemon manually:

Tested at ::2:

goya$ host rigel
rigel.home.lan has address 10.0.0.10
goya$ host 10.0.0.10
10.0.0.10.in-addr.arpa domain name pointer rigel.home.lan.
openhrc# cat /var/unbound/etc/unbound.conf

server:
    access-control: 0.0.0.0/0 refuse
    access-control: 127.0.0.0/8 allow
    access-control: ::0/0 refuse
    access-control: ::1 allow
    access-control: 10.0.0.0/24 allow

    interface: 10.0.0.1
    #do-ip6: no

    logfile: "unbound.log"
    verbosity: 1
    use-syslog: yes
    log-time-ascii: yes
    log-queries: yes

    hide-identity: yes
    hide-version: yes

    auto-trust-anchor-file: "/var/unbound/db/root.key"
    val-log-level: 2

    # Inline RRs for home.lan
    local-data: 'rigel.home.lan. IN A 10.0.0.10'
    local-data: '10.0.0.10.in-addr.arpa. IN PTR rigel.home.lan.'

remote-control:
     control-enable: yes
     control-interface: /var/run/unbound.sock