# resolv.conf and many subdomains

## vad3r

Hi all,

we're currently preparing a new DNS setup for our datacenter and figured out problems with our subdomains and resolv.conf. By now we have 11 subdomains (like adm.dc1.de.example.com, db.dc1.de.example.com,...) and the resolver won't work as expected. I read the manpage for resolv.conf and saw that there can only be 6 domains to search in. Is there any way we can get around this limitation??

Regards

Daniel

----------

## bunder

i'm just thinking out loud with this one, but could you maybe specify the domain as a whole?  since you're using AD, it should be able to determine which subdomain you're looking for... i think.   :Laughing: 

----------

## vad3r

I'm definitively not a AD user. It's a simple BIND setup with 11 subdomains.  :Cool: 

----------

## bunder

 *vad3r wrote:*   

> I'm definitively not a AD user. It's a simple BIND setup with 11 subdomains. 

 

ah, when i see dc1, i usually think domain controller... my bad.   :Laughing: 

----------

## UberLord

You'll need to setup a local dns resolver.

libc dns resolver is very basic, and when you add things like vpn into the mix it really starts to suck. But all is not lost!

Using resolvconf-gentoo and a local resolver that supports it, like dnsmasq (or bind or djbdns) you can do so much more.

----------

## vad3r

So the only way to get this done is to use something like dnsmasq on every server???

----------

## UberLord

The way you want it to work yes.

However, I do suggest you re-think your dns strategy as if you're searching through all those sub domains it will be fairly slow.

----------

## vad3r

Thanks for your help. The strategy with this many subdomains was designed cause it matches the VLAN's and server categories. Putting them all in a single somian would it make pretty chaotic i think   :Confused: 

----------

## vad3r

Can you give me a hint how to setup dnsmasq for this specific scenario?? I experimented with dnsmasq but can't get it to work   :Crying or Very sad: 

----------

## UberLord

Hmmm. I think I was mistaken and you're stuck with a 6 domain limit. Sorry.

----------

## think4urs11

a little trick might help in your case.

You can circumvent the resolvers '6 domains only limit' by adding options ndots:2 to /etc/resolv.conf (and have the searchlist as 'search example.com' only)

e.g.

```
server 1.2.3.4

options ndots:2

search example.com
```

now you should be able to have a machine like server4711.vlan0815.example.com resolved by typing ping server4711.vlan0815

Now every name having less than 2 dots in it will be tested/resolved against the searchlist. (ndots default is 1 as you might have assumed by now)

----------

