# BIND named wildcard to different domain.

## eccerr0r

I wonder if anyone has done this with their BIND.

My *#()@&!#ing router/DSL modem's dnsmasq server decides to give out a domain name of .Home and a search path of .Home.  I couldn't seem to find a way to rebuild the firmware such that it can be configured to my personal non-public DNS domain so it could use my caching DNS server.

The main reason that I want to use my own caching DNS server?  The hardcoded servers on my DSL modem do wildcards to the ISP's search engine... GRR.  So when I try to access a nonexistent host, it connects to my ISP's catch all... GRRR!!!

I figured out a way to get it to dole out my private DNS server, but the domains don't match (it insists on using .Home).

My hack was to make my private DNS server respond to .Home and cname them to my private local domain...  I thought about manually adding entries in, but is it possible to get bind to map:

$ORIGIN Home.

*. CNAME $1.privatedomain.

so that foo.Home will return CNAME to foo.privatedomain.  I also have privatedomain on the same bind server...

Is this possible via a regular file?  Or will I have to hack bind to do this?

Oh and yes, supposedly this is somewhat of a GPL violation.  I should have the right to update my busybox on this router...

----------

## fernan82

There should be an option on your router to set it. Usually Host Name or something like that on your WAN setup. If you leave it blank and it defaults to .Home then setting to a dot should fix it.

I had a similar problem: my isp doles out their own domain so they can send send you to their own page when you lookup a bad domain. If I leave the option blank the router passes it along to all stations and that breaks wins resolution since I had nsswitch set to check DNS first which would never fail with that domain so all my smb hosts where resolving to my ISP address. Setting that field to a dot fixed it for me.

----------

## fernan82

Also a simpler solution for you may be to just use Google's public DNS servers:

8.8.8.8

4.4.4.4

You will still have to get rid of the .Home domain suffux but you won't need to run your own DNS server just for that.

<edit>

Most likely .Home is your ISP's domain so once you get rid of it you will be able to use use your ISP's DNS without it resolving invalid names to their own address. If your router doesn't have this option (it should) you can always use a static IP without using the router's DHCP server.

I use google's DNS because my ISP fails to resolve some domains correctly sometimes. Specifically it resolves gentoo.org domains wrong quite often.

As an added bonus, some paid WiFi hotspots simply use DNS redirection to take you to their pay/login page so by using Google's public DNS you get them free  :Wink: 

</edit>

----------

## eccerr0r

(A) There is not an option at all on the crappy firmware that came with the modem/router.

(B) I want my home machines to be resolved by name, not just external machines.

----------

## fernan82

I haven't seen one that doesn't have it (it's required by some ISPs) but since yours is a modem/router combo it may be different. If you must use DHCP then the easiest way to go is probably to run your own DHCP server and switch off the one on the router. Otherwise I think do have to hack bind for what you want. I'm not familiar with bind but it's not a standard dns feature.

----------

## eccerr0r

That's what I feared, didn't think multiple to multiple mapping was a standard feature of BIND.  I want to try to use the modem/router combo to try to keep as much as possible running on the device in case my DNS server goes down (and likely the DHCP server would be running on this machine and it would also go down) - then in this case I'd rather it failover to using the ISP DNS server solely.  Currently I have it set (luckily) to dole out my local DNS server first, then as a secondary use the ISP DNS server.

The annoying router/modem combo is an Actiontec Q1000, Qwest branded (Centurylink).

I guess I should script the conversion of all local A records to a CNAME record, perhaps hook it into the startup script.  Not pleasant but it's the best that I can do until I can figure out how to unpack, edit, and repack the firmware to flash on the router/modem ...

----------

## fernan82

Is this what your router's utility looks like? http://internethelp.centurylink.com/internethelp/modem-q1000-setup-quick.html

Out of curiosity, what happens if you choose "Other ISP"? does it show any extra fields?

----------

## eccerr0r

Yes that's my modem. 

No I cannot select another ISP, because I don't subscribe to another ISP and thus will never authenticate pppoe.  No fields show up anyway, I suspect I have to add @xyz.abc for the other ISPs.

The problem to work around is purely in the limited firmware of the modem.

----------

