Koozali.org: home of the SME Server

Contribs.org Forums => General Discussion => Topic started by: Marco Hess on April 07, 2011, 04:09:21 AM

Title: How can I get DNS to resolve the IP for an external host on same base domain?
Post by: Marco Hess on April 07, 2011, 04:09:21 AM
I am trying to setup a server at a remote location (for backup purposes).

I like to setup that server as a host under my own domain like in backuphost.mydomain.com and on that machine I have set ddclient to update it's external visible IP in my DynDNS account. As far as I can tell that works. The IP for the external host gets correctly updated and when on the public internet that resolves to the right IP address for that external host.

However, when inside by office network backuphost.mydomain.com does not resolve to anything.

The only way to make it resolve to anything is configure it as an external host in server-manager panel. I rather not do this as this host is on a dynamic IP (that is why I use ddclient :-) ).

Is there a way to make SME server try with an external DNS for host names in the local domain that it does not know about?
Title: Re: How can I get DNS to resolve the IP for an external host on same base domain?
Post by: CharlieBrady on April 07, 2011, 02:08:13 PM
You would need to use a custom template to add a CNAME record to the tinydns data file on your SME server.
Title: Re: How can I get DNS to resolve the IP for an external host on same base domain?
Post by: Stefano on April 07, 2011, 02:25:34 PM
maybe this (http://forums.contribs.org/index.php/topic,37583.0.html) is what you are looking for
Title: Re: How can I get DNS to resolve the IP for an external host on same base domain?
Post by: Marco Hess on April 08, 2011, 02:17:01 AM
I am not sure it is a matter of redirecting with CNAME's. I think ideally SME should when its DNS is asked for a 'somehost.mydomain.com' and if the 'somehost' is not known as one of the local host names or aliases it would forward the request to an external DNS resolver.

I think some of the discussion in Bug 2294 is talking about the same issue. Like if a user host an external website on their www.mydomain.com the only way to address that is to override the www.mydomain.com with the IP of the external host.

I think it may be more clean if the internal SME DNS would simply forward DNS requests it can't resolve locally and the externally configured DNS records would take over.

I looked at the tinydns data file but have trouble in making enough sense of it to see how it can be set so that requests for unknown records get forwarded. Maybe that is even in a different file?
Title: Re: How can I get DNS to resolve the IP for an external host on same base domain?
Post by: Marco Hess on April 08, 2011, 02:20:18 AM
Maybe I found part of the answer here:

http://www.sixxs.net/wiki/Djbdns

tinydns is the server that only answers for iterative requests which for which are in its database; it is the server that a dnscache or other client will find to resolve an address for the tinydns server's zone. It does not forward requests to other servers.
Title: Re: How can I get DNS to resolve the IP for an external host on same base domain?
Post by: CharlieBrady on April 08, 2011, 04:05:05 AM
I think ideally SME should when its DNS is asked for a 'somehost.mydomain.com' and if the 'somehost' is not known as one of the local host names or aliases it would forward the request to an external DNS resolver.

You can think whatever you want about what SME servers resolver *should* do, but that won't change what it *does* do.

SME server's dnscache (recursive resolver) will follow the CNAME. The CNAME is the correct answer to the particular problem which you posed.