Custom DNS Zones (CLI)

Forums > How-To > Custom DNS Zones (CLI)

Post #1
Custom DNS zone management does not exist in the UI at the moment. I began working on this In the "Zone Manager" but I have not made much progress. Also, this is a feature of RazDC3 I have been meaning to implement once again, I just haven't taken the time to build this in due to documentation and bugs. The good news is, you can still do this from the console (I realize this is not very convenient, but It's the best I can do at the moment). The Samba-tool will give you access to these features:

" /usr/local/samba/bin/samba-tool  dns zonecreate [YOURDC] [NEWZONE] --username=[ADMINISTRATOR]"

e.g., if your domain is "mydc.local" and you want to create a new zone called "myzone.org" using administrator you would type:

" /usr/local/samba/bin/samba-tool  dns zonecreate mydc.local myzone.org --username=administrator"

This  just tells samba to create the new zone "myzone.org" on the domain server for "mydc.local" using the administrator account.

It will prompt you for the administrator password, and the zone will appear in the UI going forward.

You can also use the password flag but this would result in the password appearing in the keytab and would be visible using "history" command so I would advise against this. But if you wish to use it you would simply add: --password=[YOURPASSWORD] to the command.

You can list all zones using "zonelist":

/usr/local/samba/bin/samba-tool  dns zonelist [YOURDOMAIN] --username=[YOURADMIN]


For record creation:


/usr/local/samba/bin/samba-tool  dns add [YOURDC] [ZONE] [RECORDNAME]  [TYPE:A|AAAA|PTR|CNAME|NS|MX|SRV|TXT ] [VALUE]

e.g.:

/usr/local/samba/bin/samba-tool dns add mydc.local myzone.org myrecordname A 192.168.0.100 --username=administrator

You  can also find additional help using the --help flag for samba-tool:

"/usr/local/samba/bin/samba-tool dns --help"

Here  is the output:

Usage: samba-tool dns <subcommand>

Domain  Name Service (DNS) management.


Options:
-h, --help show  this help message and exit


Available  subcommands:
  add - Add  a DNS record
  cleanup - Cleanup  DNS records for a DNS host.
  delete - Delete  a DNS record
  query - Query  a name.
  roothints - Query  root hints.
  serverinfo - Query  for Server information.
  update - Update  a DNS record
  zonecreate - Create  a zone.
  zonedelete - Delete  a zone.
  zoneinfo - Query  for zone information.
  zonelist - Query  for zones.
  zoneoptions - Change  zone aging options.
For more help on a specific subcommand, please type: samba-tool dns <subcommand> (-h|--help)



I hope this helps you until I can get the web UI complete.
Bryan King

Sorry, this topic is not accepting new posts.