Large number of stub zones

Is there a nice and elegant way to have a large number domains defined
as stub zone? I'd like to tell unbound to use an authoritative DNS on
127.0.0.2 for a large number of domains. I haven't tried yet, but I
don't think the stub zone mechanism was built for a large number of
stub zones.

Anyone a suggestion?

R.

Stub zones work absolutely fine for this; I have 50k randomly generated
domains hosted in nsd and use stub zones in unbound to tie them
together. It is ideal for a test network where you want to ensure that
you are not reliant on outside DNS infrastructure for your queries.

John

But does that mean that unbound parses each entry of the list for
every query it does? Or does unbound build an internal indexed database
of the stub zones when starting?

I'm not familiar with the internals of unbound, that's the reason why I
ask this question, I'd like to know if this method of using thousands
of stub zone files is an appropiate way to do things like this...

R.

But does that mean that unbound parses each entry of the list for
every query it does? Or does unbound build an internal indexed database
of the stub zones when starting?

I'll leave someone else to answer this question.

I'm not familiar with the internals of unbound, that's the reason why I
ask this question, I'd like to know if this method of using thousands
of stub zone files is an appropiate way to do things like this...

I certainly wouldn't use thousands of files; I include a file that
contains all of the generated stubs blocks.

John

ok, sorry, I forgot to mention that I use the old djbdns way to
determine stub zones. Indeed, from these files I generate 1 file with
entries like this:

stub-zone:
        name: "domain1.tld"
        stub-addr: 127.0.0.1
stub-zone:
        name: "domain2.tld"
        stub-addr: 127.0.0.1
stub-zone:
        name: "domain3.tld"
        stub-addr: 127.0.0.1

So, I repeat my question in a proper way now :slight_smile: Is it a problem if this
file contains thousands of entries?

R.

richard lucassen:

stub-zone:
        name: "domain1.tld"
        stub-addr: 127.0.0.1
stub-zone:
        name: "domain2.tld"
        stub-addr: 127.0.0.1
stub-zone:
        name: "domain3.tld"
        stub-addr: 127.0.0.1

what about measurement?

create a config with *one* stub and thousands of dummy stubs.
then time some queries.

Of course I can and I know it will work, but the question remains if it
is an elegant way to achieve this goal.

R.