diff --git a/designate_tempest_plugin/clients.py b/designate_tempest_plugin/clients.py
index 5edc75a..9e64b15 100644
--- a/designate_tempest_plugin/clients.py
+++ b/designate_tempest_plugin/clients.py
@@ -28,6 +28,8 @@
     RecordsetClient
 from designate_tempest_plugin.services.dns.v2.json.pool_client import \
     PoolClient
+from designate_tempest_plugin.services.dns.v2.json.tld_client import \
+    TldClient
 
 CONF = config.CONF
 
@@ -56,3 +58,5 @@
                                                 **params)
         self.pool_client = PoolClient(self.auth_provider,
                                       **params)
+        self.tld_client = TldClient(self.auth_provider,
+                                    **params)
diff --git a/designate_tempest_plugin/data_utils.py b/designate_tempest_plugin/data_utils.py
index d3c72cc..f18e87c 100644
--- a/designate_tempest_plugin/data_utils.py
+++ b/designate_tempest_plugin/data_utils.py
@@ -206,3 +206,10 @@
     ns_records = [{"hostname": x, "priority": random.randint(1, 999)}
                   for x in records]
     return ns_records
+
+
+def rand_tld():
+    data = {
+        "name": rand_zone_name(prefix='tld', suffix='')
+    }
+    return data
diff --git a/designate_tempest_plugin/services/dns/v2/json/tld_client.py b/designate_tempest_plugin/services/dns/v2/json/tld_client.py
new file mode 100644
index 0000000..d6b3c66
--- /dev/null
+++ b/designate_tempest_plugin/services/dns/v2/json/tld_client.py
@@ -0,0 +1,103 @@
+# Copyright 2016 NEC Corporation.  All rights reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from tempest.lib.common.utils import data_utils
+
+from designate_tempest_plugin.services.dns.v2.json import base
+
+
+class TldClient(base.DnsClientV2Base):
+    """API V2 Tempest REST client for Designate Tld API"""
+
+    @base.handle_errors
+    def create_tld(self, tld_name=None, description=None, params=None):
+        """Create a tld with the specified parameters.
+        :param tld_name: Name of the tld. e.g .com .
+        :param description: represents details of tld.
+        :param params: A Python dict that represents the query paramaters to
+                       include in the request URI.
+        :return: A tuple with the server response and the created tld.
+        """
+        tld = {
+                "name": tld_name or data_utils.rand_name(name="tld"),
+                "description": description or data_utils.rand_name(
+                               name="description")
+        }
+
+        resp, body = self._create_request('tlds', object_dict=tld,
+                                          params=params)
+
+        # Create Tld should Return a HTTP 201
+        self.expected_success(201, resp.status)
+
+        return resp, body
+
+    @base.handle_errors
+    def show_tld(self, uuid, params=None):
+        """Gets a specific tld.
+        :param uuid: Unique identifier of the tld in UUID format.
+        :param params: A Python dict that represents the query paramaters to
+                       include in the request URI.
+        :return: Serialized tld as a dictionary.
+        """
+        return self._show_request('tlds', uuid, params=params)
+
+    @base.handle_errors
+    def list_tlds(self, params=None):
+        """Gets a list of tlds.
+        :param params: A Python dict that represents the query paramaters to
+                       include in the request URI.
+        :return: Serialized tlds as a list.
+        """
+        return self._list_request('tlds', params=params)
+
+    @base.handle_errors
+    def delete_tld(self, uuid, params=None):
+        """Deletes a tld having the specified UUID.
+        :param uuid: The unique identifier of the tld.
+        :param params: A Python dict that represents the query paramaters to
+                       include in the request URI.
+        :return: A tuple with the server response and the response body.
+        """
+        resp, body = self._delete_request('tlds', uuid, params=params)
+
+        # Delete Tld should Return a HTTP 204
+        self.expected_success(204, resp.status)
+
+        return resp, body
+
+    @base.handle_errors
+    def update_tld(self, uuid, tld_name=None, description=None, params=None):
+        """Update a tld with the specified parameters.
+        :param uuid: The unique identifier of the tld.
+        :param tld_name: Name of the tld. e.g .com .
+        :param description: represents info about tld.
+        :param params: A Python dict that represents the query paramaters to
+                       include in the request URI.
+        :return: A tuple with the server response and the updated tld.
+        """
+
+        tld = {
+                 "name": tld_name or data_utils.rand_name(name="tld"),
+                 "description": description or data_utils.rand_name(
+                                name="description")
+        }
+
+        resp, body = self._update_request('tlds', uuid, tld,
+                                          params=params)
+
+        # Update Tld should Return a HTTP 200
+        self.expected_success(200, resp.status)
+
+        return resp, body
diff --git a/designate_tempest_plugin/tests/api/v2/test_tld.py b/designate_tempest_plugin/tests/api/v2/test_tld.py
new file mode 100644
index 0000000..46e5b48
--- /dev/null
+++ b/designate_tempest_plugin/tests/api/v2/test_tld.py
@@ -0,0 +1,120 @@
+# Copyright 2016 NEC Corporation.  All rights reserved.
+#
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from oslo_log import log as logging
+from tempest import test
+from tempest.lib import exceptions as lib_exc
+
+from designate_tempest_plugin.tests import base
+
+LOG = logging.getLogger(__name__)
+
+
+class BaseTldTest(base.BaseDnsTest):
+    excluded_keys = ['created_at', 'updated_at', 'links']
+
+
+class TldAdminTest(BaseTldTest):
+    credentials = ['admin']
+
+    @classmethod
+    def setup_clients(cls):
+        super(TldAdminTest, cls).setup_clients()
+        cls.admin_client = cls.os_adm.tld_client
+
+    @classmethod
+    def resource_setup(cls):
+        super(TldAdminTest, cls).resource_setup()
+        cls.tld = cls.admin_client.create_tld(tld_name='com',
+                      ignore_errors=lib_exc.Conflict)
+
+    @test.attr(type='smoke')
+    @test.idempotent_id('52a4bb4b-4eff-4591-9dd3-ad98316806c3')
+    def test_create_tld(self):
+        tld_data = {
+                     "name": "org",
+                     "description": "sample tld"}
+
+        LOG.info('Create a tld')
+        _, tld = self.admin_client.create_tld(tld_data['name'],
+                                        tld_data['description'])
+        self.addCleanup(self.admin_client.delete_tld, tld['id'])
+
+        self.assertEqual(tld_data["name"], tld['name'])
+
+    @test.attr(type='smoke')
+    @test.idempotent_id('271af08c-2603-4f61-8eb1-05887b74e25a')
+    def test_show_tld(self):
+        tld_data = {
+                     "name": "org",
+                     "description": "sample tld"}
+
+        LOG.info('Create a tld')
+        _, tld = self.admin_client.create_tld(tld_data['name'],
+                                        tld_data['description'])
+        self.addCleanup(self.admin_client.delete_tld, tld['id'])
+
+        LOG.info('Fetch the tld')
+        _, body = self.admin_client.show_tld(tld['id'])
+
+        LOG.info('Ensure the fetched response matches the created tld')
+        # self.assertExpected(tld, body, self.excluded_keys)
+
+    @test.attr(type='smoke')
+    @test.idempotent_id('26708cb8-7126-48a7-9424-1c225e56e609')
+    def test_delete_tld(self):
+        LOG.info('Create a tld')
+        _, tld = self.admin_client.create_tld()
+        self.addCleanup(self.admin_client.delete_tld, tld['id'],
+                        ignore_errors=lib_exc.NotFound)
+
+        LOG.info('Delete the tld')
+        _, body = self.admin_client.delete_tld(tld['id'])
+
+        self.assertRaises(lib_exc.NotFound,
+           lambda: self.admin_client.show_tld(tld['id']))
+
+    @test.attr(type='smoke')
+    @test.idempotent_id('95b13759-c85c-4791-829b-9591ca15779d')
+    def test_list_tlds(self):
+        LOG.info('List tlds')
+        _, body = self.admin_client.list_tlds()
+
+        self.assertGreater(len(body['tlds']), 0)
+
+    @test.attr(type='smoke')
+    @test.idempotent_id('1a233812-48d9-4d15-af5e-9961744286ff')
+    def test_update_tld(self):
+        _, tld = self.admin_client.create_tld()
+        self.addCleanup(self.admin_client.delete_tld, tld['id'])
+
+        tld_data = {
+                     "name": "org",
+                     "description": "Updated description"
+        }
+
+        LOG.info('Update the tld')
+        _, patch_tld = self.admin_client.update_tld(tld['id'],
+                       tld_data['name'], tld_data['description'])
+
+        self.assertEqual(tld_data["name"], patch_tld["name"])
+        self.assertEqual(tld_data["description"], patch_tld["description"])
+
+    @test.attr(type='smoke')
+    @test.idempotent_id('8116dcf5-a329-47d1-90be-5ff32f299c53')
+    def test_list_tlds_dot_json_fails(self):
+        uri = self.admin_client.get_uri('tlds.json')
+
+        self.assertRaises(lib_exc.NotFound,
+            lambda: self.admin_client.get(uri))
