Author Topic: How to stop/forward queries for hosts on same domain  (Read 1904 times)

otoh

  • Zen Apprentice
  • *
  • Posts: 34
  • Karma: +1/-0
    • View Profile
How to stop/forward queries for hosts on same domain
« on: April 03, 2013, 01:54:09 pm »
I have a public webserver, www.mydomain.com, which serves DNS for the domain mydomain.com. That all works fine. I have set up my zentyal server - to serve mail, smb, etc, on my internal network as office.mydomain.com (host office on domain mydomain.com). I don't particularly need DNS services on it, but the other services require it.

Problem is now that my Zentyal server cannot resolve eg www.mydomain.com and news.mydomain.com - it claims ownership of mydomain.com and because these hosts are not set in it's own DNS, it cannot resolve them. My DNS records are a little tricky to replicate on Zentyal, so I would ideally like it to forward requests to eg my internal router, which will handle searching elsewhere for them.

Think I might have planned wrong here somewhere by using mydomain.com as the domain of my computer :| But any ideas much appreciated...


christian

  • Guest
Re: How to stop/forward queries for hosts on same domain
« Reply #1 on: April 03, 2013, 02:01:02 pm »
Using same domain for internal and external sides of your network is definitely NOT a wrong idea if you do understand what are the pros & cons.

My current setup is implementing same design and I do not face any issue (meaning yes it works  ;D)
what you have to do is to define, in Zentyal DNS, A records and CNAME for external servers, that's it.
As we discuss this, I would like to remind that Zentyal does not support (yet  ???) split-DNS design which means that you should not use same (Zentyal) DNS server to server internal and external users (I know you don't do it but I'm stating this for those who may think about this.

otoh

  • Zen Apprentice
  • *
  • Posts: 34
  • Karma: +1/-0
    • View Profile
Re: How to stop/forward queries for hosts on same domain
« Reply #2 on: April 03, 2013, 05:48:25 pm »
My current setup is implementing same design and I do not face any issue (meaning yes it works  ;D)
what you have to do is to define, in Zentyal DNS, A records and CNAME for external servers, that's it.

Hi Christian - thanks again for your reply. I thought what I was doing was OK - I did the same on my previous Mac server but I guess it doesn't treat DNS the same way so I didn't have this problem. I can't replicate the existing setup exactly as I'd like - but I've got it so it works. The tricky one was my website which is just domain.com as opposed to www.domain.com - I changed the IP address of the core domain but it kept resetting to the internal IP of the machine - but I got it to stick after a few goes!

christian

  • Guest
Re: How to stop/forward queries for hosts on same domain
« Reply #3 on: April 03, 2013, 06:09:24 pm »
Unless I don't understand something, your web server is not listening at domain.com (well, not at domain.com only)
there is something I suppose not well understood regarding services, DNS and domain. You're not the only one and I remember having already discussed this long time ago on this same forum.

domain.com describes your domain (from DNS standpoint)
This covers all hosts and services one can find while resolving something.domain.com
This said, you may have defined in you DNS some entry aiming to catch any request not built with host.domain.com
That's an option, nevertheless, services hosted by servers are all supposed to be reachable using host.domain.com
that's also true for your web server:
this service is running on server that has, for sure, well defined host name. This said, one can configure web server (e.g. Apache) to answer to any request, kind of "catch all" mechanism: even if you don't ask for www.domain.com, then server will answer with www.domain.com (this works if you ask for domain.com)

but all these mechanisms are, somewhat, special implementations  ;)

BTW, I don't understand what:
Quote
I changed the IP address of the core domain
means  :-[

otoh

  • Zen Apprentice
  • *
  • Posts: 34
  • Karma: +1/-0
    • View Profile
Re: How to stop/forward queries for hosts on same domain
« Reply #4 on: April 03, 2013, 06:18:28 pm »
Unless I don't understand something, your web server is not listening at domain.com
this service is running on server that has, for sure, well defined host name. This said, one can configure web server (e.g. Apache) to answer to any request, kind of "catch all" mechanism: even if you don't ask for www.domain.com, then server will answer with www.domain.com (this works if you ask for domain.com)

but all these mechanisms are, somewhat, special implementations  ;)

Aha, good point. My main web server has an A record (to itself) for mydomain.com; and a CNAME for www.mydomain.com - so the relevant vhost responds to either. However, I have set up my vhost to always redirect to mydomain.com rather than www.mydomain.com - I think it's neater, a la twitter etc.

BTW, I don't understand what:
Quote
I changed the IP address of the core domain
means  :-[

That was the tricky bit. In Zentyal > Infrastructure > DNS, I have one domain, mydomain.com

When I click Domain IP addresses, I see the IP address of my server (eg 192.168.0.100) and when I click Hostnames, there is one entry, 'office', with the same IP address.

In this setup, mydomain.com - just on its own - would resolve to the internal IP of the server, preventing me from accessing my website from it. So I kept the internal IP assigned to office.mydomain.com. but clicked Domain IP addresses to change the IP of mydomain.com to that of my public webserver. It seems that depending on what other changes you make in DNS, Zentyal wants to reset this back to the address of the machine - but I got it to stick and it seems to work so far :)
« Last Edit: April 03, 2013, 06:22:31 pm by otoh »

christian

  • Guest
Re: How to stop/forward queries for hosts on same domain
« Reply #5 on: April 03, 2013, 06:32:17 pm »
As I said, you're not the only one  ;)
Even Zentyal interface allows to set (optional) IP address associated to domain concept.
I would really like Zentyal to explain what this means because I don't know  :-[

I'll try to ask on Zentyal IRC and may come back here in case I get an answer.