[Samba] Samba4 DNS - Adding CNAME

Mike Howard mike at dewberryfields.co.uk
Tue May 22 13:14:28 MDT 2012


On 21/05/2012 20:38, Charles Tryon wrote:
> I have been working on this too, and found that I needed to add the 
> FQDN as the target of the CNAME.  This is what appears to be 
> happening...  When I just put in the name, for example:
>
>     samba-tool dns add dnsserver mydomain.org <http://mydomain.org> 
> newname CNAME realname
>
> ...and I use the Windows DNS tool to look at the record in the 
> mydomain.org <http://mydomain.org> zone, it maps "newname" to 
> "realname." <--- NOTICE the "dot" at the end.  In DNS parlance, that 
> dot usually means, "don't add anything after this."  So, when DNS is 
> trying to resolve the actual IP, it tries to look up "realname" with 
> no domain, and eventually times out.  If you change this to:
>
>     samba-tool dns add dnsserver mydomain.org <http://mydomain.org> 
> newname CNAME realname.mydomain.org <http://realname.mydomain.org>
>
> ... then doing a "dig" or "ping" or whatever seems to work correctly.
>
>   I may be doing this wrong, but at least this is how I got it to work.
>
>
>
> On Sat, May 19, 2012 at 6:57 AM, Mike Howard 
> <mike at dewberryfields.co.uk <mailto:mike at dewberryfields.co.uk>> wrote:
>
>     On 19/05/2012 11:12, Michael Wood wrote:
>
>
>         So, the question is; What am I doing wrong?
>
>                 I haven't tried the above myself, but it seems you are
>                 adding it the
>                 wrong way around.  i.e. it looks like you are saying
>                 that the
>                 canonical name of "centos" is "debian" instead of what
>                 you want (i.e.
>                 that the canonical name of "debian" is "centos".)
>
>                 i.e. it looks like you now have this situation:
>
>                 centos IN A 192.168.1.11
>                 centos IN CNAME debian
>
>             Yes, I did wonder about that and did try it the other way
>             around. That
>             resulted in a new record as follows;
>
>              Name=debian, Records=1, Children=0
>                CNAME: centos. (flags=f0, serial=21, ttl=900)
>
>             But it still doesn't resolve.
>
>         OK, then try specifying the FQDN for "centos" when you add the
>         CNAME
>         record.  From the output above it looks like it's adding a
>         CNAME to
>         "centos." instead of "centos.example.com
>         <http://centos.example.com>".
>
>         Also try:
>
>         dig @192.168.1.254 <http://192.168.1.254> debian.example.com
>         <http://debian.example.com>. IN CNAME
>
>         If everything is set up correctly you should get something
>         like this:
>
>         [...]
>         ;; QUESTION SECTION:
>         ;debian.example.com <http://debian.example.com>.            IN
>              CNAME
>
>         ;; ANSWER SECTION:
>         debian.example.com <http://debian.example.com>.     3600    IN
>              CNAME centos.example.com <http://centos.example.com>.
>         [...]
>
>     Ok, I used;
>
>     samba-tool dns add 127.0.0.1 example.com <http://example.com>
>     debian CNAME centos.example.com <http://centos.example.com>
>
>     a query now returns;
>
>
>      Name=centos, Records=1, Children=0
>        A: 192.168.1.11 (flags=f0, serial=2, ttl=900)
>      Name=debian, Records=1, Children=0
>        CNAME: centos.example.com <http://centos.example.com>.
>     (flags=f0, serial=23, ttl=900)
>
>     and 'dig @192.168.1.254 <http://192.168.1.254> debian.example.com
>     <http://debian.example.com>. IN CNAME' returns;
>
>
>     [...]
>
>     ;; QUESTION SECTION:
>     ;debian.example.com <http://debian.example.com>.   IN      CNAME
>
>     ;; ANSWER SECTION:
>     debian.example.com <http://debian.example.com>. 900 IN     CNAME
>     centos.example.com <http://centos.example.com>.
>
>     [...]
>
>     However, neither 'debian' nor 'debian.example.com
>     <http://debian.example.com>' resolve to an IP, yet the output from
>     dig implies the entry is correct? Of course, 'centos' does resolve.
>
>
>     -- 
>     Any question is easy if you know the answer!
>     -- 
>     To unsubscribe from this list go to the following URL and read the
>     instructions: https://lists.samba.org/mailman/options/samba
>
>
>
>
> -- 
>     Charles Tryon
> _________________________________________________________________________
>   “Risks are not to be evaluated in terms of the probability of 
> success, but in terms of the value of the goal.”
>                 - Ralph D. Winter
>

Well I too got dig, on the server, to produce the correct output but the 
hostname (either short or fully qualified) would  not resolve to an ip 
address from _any_ clients. I'm using the internal dns server by the way.

As I mentioned, I bodged it by just adding would be CNAME entries as A 
records. Not orthodox but it works for now.

-- 
Any question is easy if you know the answer!


More information about the samba mailing list