Have static records in forwarded zone

Hello,

I try to create a bit strange setup. I use unbound as a caching server and it works fine. Then, I need it to resolve only limited set of domains, so I add something like:

do-not-query-address: 127.0.0.0/8

forward-zone:
  name: "incapdns.net."
  forward-addr: 8.8.8.8
  forward-addr: 8.8.4.4

forward-zone:
  name: "."
  forward-addr: 127.0.0.255

to the config and all that unbound can resolve is incapdns.net domain.

Now it the tricky part. In our company we have a domain that is on external DNSes and it warks fine but I need to have several records modified. Say, if you query for mail.domain.com from outside it answer you with IP of our office but if you query the same name from inside the LAN it should answer you with LAN address of mail server.

So what I'd like to do is to have something like that:

local-zone: "domain.com" typetransparent
local-data: "mail.domain.com A 192.168.17.2"

but this won't work.

How can I create the setup I need? I understand this is the case where split zone fits nicely but then I'll need to maintain the whole zone both remotely and locally, and I'd like to forward it to zone's DNSes for all records but for these that I have locally.

Thank you in advance,
   Alexander

Hi,

Yes, you're right, but I'm not sure if typetransparent solves my question.

What I need is to serve static records from config for several hosts and forward all other records to the public recursors like 8.8.8.8 - will typetransparent do exactly that?

It's the right type, nut you may have other issues you're overlooking.
If you're enforcing that private-address range you'll need to to add a
private-domain statement for the local domain. If you're validating
you may need to add a domain-insecure statement for the local domain.
Ex:

Hi. I'm am unbound beginner, so take my opinion with caution.

transparent and typeransparent are very similar and only differs in
how manage a query for a record type not included in localdata. See
man unbound.conf

I think you need something like this:

forward-zone:
        name: "domain.com"
        forward-addr: 8.8.8.8

But I'm not how can you avoid that your forward-zone "." take precedence.

I know that you can separate sections with aditional server: lines,
but I don't know how respond in this case.

Regards
Norberto

www.redklee.com.ar
tel [+54] 11 5273 6342
cel [+54 9] 11 5055 9853
linkedin