[Samba] How to use samba-tool dns to manually add a PTR record

Rowland Penny rpenny at samba.org
Thu Nov 4 18:24:18 UTC 2021


On Thu, 2021-11-04 at 12:59 -0500, Patrick Goetz via samba wrote:
> Here is the relevant docstring:
> 
> root at atomsmasher:~# samba-tool dns add -h
> Usage: samba-tool dns add <server> <zone> <name> 
> <A|AAAA|PTR|CNAME|NS|MX|SRV|TXT> <data>
> 
> Add a DNS record
> 
> For each type data contents are as follows:
>    A      ipv4_address_string
>    AAAA   ipv6_address_string
>    PTR    fqdn_string
>    CNAME  fqdn_string
>    NS     fqdn_string
>    MX     "fqdn_string preference"
>    SRV    "fqdn_string port priority weight"
>    TXT    "'string1' 'string2' ..."
> 
> 
> What does "fqdn_string" mean?  Because I tried this:
> 
> root at samba-dc:~# samba-tool dns add samba-dc ea.linuxcs.com
> atomsmasher 
> PTR atomsmasher.ea.linuxcs.com
> 
> and it didn't work:

You got the '<data>' correct, but you got the '<zone>' and '<name>'
wrong

You are adding a PTR record and this is added to your reverse zone, the
one that ends in 'arpa'. The '<name>' in this case is the IP, so your
command should be:

samba-tool dns add samba-dc 1.168.192.in-addr.arpa 82 PTR
atomsmasher.ea.linuxcs.com

Rowland





More information about the samba mailing list