diff --git a/neutron_tempest_plugin/scenario/test_dns_integration.py b/neutron_tempest_plugin/scenario/test_dns_integration.py
index d520aa2..8163b51 100644
--- a/neutron_tempest_plugin/scenario/test_dns_integration.py
+++ b/neutron_tempest_plugin/scenario/test_dns_integration.py
@@ -39,6 +39,8 @@
 # when designate_tempest_plugin is not available
 dns_base = testtools.try_import('designate_tempest_plugin.tests.base')
 dns_waiters = testtools.try_import('designate_tempest_plugin.common.waiters')
+dns_data_utils = testtools.try_import('designate_tempest_plugin.data_utils')
+
 if dns_base:
     DNSMixin = dns_base.BaseDnsV2Test
 else:
@@ -52,8 +54,9 @@
     def setup_clients(cls):
         super(BaseDNSIntegrationTests, cls).setup_clients()
         cls.zone_client = cls.os_tempest.dns_v2.ZonesClient()
+        cls.admin_zone_client = cls.os_admin.dns_v2.ZonesClient()
         cls.recordset_client = cls.os_tempest.dns_v2.RecordsetClient()
-        cls.query_client.build_timeout = 30
+        cls.query_client.build_timeout = 60
 
     @classmethod
     def skip_checks(cls):
@@ -68,12 +71,13 @@
     @utils.requires_ext(extension="dns-integration", service="network")
     def resource_setup(cls):
         super(BaseDNSIntegrationTests, cls).resource_setup()
-        cls.zone = cls.zone_client.create_zone()[1]
-        cls.addClassResourceCleanup(cls.zone_client.delete_zone,
-            cls.zone['id'], ignore_errors=lib_exc.NotFound)
-        dns_waiters.wait_for_zone_status(
-            cls.zone_client, cls.zone['id'], 'ACTIVE')
-
+        cls.zone_name = dns_data_utils.rand_zone_name(
+            name="basednsintegrationtests")
+        cls.zone = cls.zone_client.create_zone(
+            name=cls.zone_name, wait_until='ACTIVE')[1]
+        cls.addClassResourceCleanup(
+            cls.zone_client.delete_zone, cls.zone['id'],
+            ignore_errors=lib_exc.NotFound)
         cls.network = cls.create_network(dns_domain=cls.zone['name'])
         cls.subnet = cls.create_subnet(cls.network)
         cls.subnet_v6 = cls.create_subnet(cls.network, ip_version=6)
@@ -81,6 +85,20 @@
         cls.create_router_interface(cls.router['id'], cls.subnet['id'])
         cls.keypair = cls.create_keypair()
 
+    @classmethod
+    def resource_cleanup(cls):
+        super(BaseDNSIntegrationTests, cls).resource_cleanup()
+        admin_listed_zones = cls.admin_zone_client.list_zones(
+            headers=dns_base.BaseDnsV2Test.all_projects_header)[1]['zones']
+        neutron_zone_ids = [
+            zn['id'] for zn in admin_listed_zones if
+            'zone for reverse lookups set up by Neutron.' in
+            str(zn['description']) and cls.zone_name.strip('.') in zn['email']]
+        for id in neutron_zone_ids:
+            cls.admin_zone_client.delete_zone(
+                id, headers=dns_base.BaseDnsV2Test.all_projects_header,
+                ignore_errors=lib_exc.NotFound)
+
     def _create_floatingip_with_dns(self, dns_name):
         return self.create_floatingip(client=self.os_primary.network_client,
                                       dns_name=dns_name,
@@ -250,7 +268,8 @@
     @classmethod
     def resource_setup(cls):
         super(DNSIntegrationExtraTests, cls).resource_setup()
-        cls.network2 = cls.create_network()
+        cls.network2 = cls.create_network(
+            name=data_utils.rand_name('dns_integration_net'))
         cls.subnet2 = cls.create_subnet(cls.network2)
         cls.subnet2_v6 = cls.create_subnet(cls.network2,
                                            ip_version=6,
@@ -274,6 +293,16 @@
         self.client.delete_port(port['id'])
         self._verify_dns_records(addr_v6, name, record_type='AAAA',
                                  found=False)
+        self.client.update_subnet(
+            self.subnet2['id'], dns_publish_fixed_ip=True)
+        port = self.create_port(self.network2,
+                                dns_domain=self.zone['name'],
+                                dns_name=name)
+        addr_v4 = port['fixed_ips'][1 - v6_index]['ip_address']
+        self._verify_dns_records(addr_v4, name, record_type='A')
+        self.client.delete_port(port['id'])
+        self._verify_dns_records(addr_v4, name, record_type='A',
+                                 found=False)
 
 
 class DNSIntegrationDomainPerProjectTests(BaseDNSIntegrationTests):
@@ -286,19 +315,15 @@
     @classmethod
     def resource_setup(cls):
         super(BaseDNSIntegrationTests, cls).resource_setup()
-
-        name = data_utils.rand_name('test-domain')
-        zone_name = "%s.%s.%s.zone." % (cls.client.user_id,
+        cls.name = data_utils.rand_name('test-domain')
+        cls.zone_name = "%s.%s.%s.zone." % (cls.client.user_id,
                                         cls.client.project_id,
-                                        name)
-        dns_domain_template = "<user_id>.<project_id>.%s.zone." % name
-
-        cls.zone = cls.zone_client.create_zone(name=zone_name)[1]
+                                        cls.name)
+        dns_domain_template = "<user_id>.<project_id>.%s.zone." % cls.name
+        cls.zone = cls.zone_client.create_zone(
+            name=cls.zone_name, wait_until='ACTIVE')[1]
         cls.addClassResourceCleanup(cls.zone_client.delete_zone,
             cls.zone['id'], ignore_errors=lib_exc.NotFound)
-        dns_waiters.wait_for_zone_status(
-            cls.zone_client, cls.zone['id'], 'ACTIVE')
-
         cls.network = cls.create_network(dns_domain=dns_domain_template)
         cls.subnet = cls.create_subnet(cls.network,
                                        dns_publish_fixed_ip=True)
@@ -309,6 +334,20 @@
         cls.create_router_interface(cls.router['id'], cls.subnet['id'])
         cls.keypair = cls.create_keypair()
 
+    @classmethod
+    def resource_cleanup(cls):
+        super(BaseDNSIntegrationTests, cls).resource_cleanup()
+        admin_listed_zones = cls.admin_zone_client.list_zones(
+            headers=dns_base.BaseDnsV2Test.all_projects_header)[1]['zones']
+        neutron_zone_ids = [
+            zn['id'] for zn in admin_listed_zones if
+            'zone for reverse lookups set up by Neutron.' in
+            str(zn['description']) and cls.zone_name.strip('.') in zn['email']]
+        for id in neutron_zone_ids:
+            cls.admin_zone_client.delete_zone(
+                id, headers=dns_base.BaseDnsV2Test.all_projects_header,
+                ignore_errors=lib_exc.NotFound)
+
     @decorators.idempotent_id('43a67509-3161-4125-8f2c-0d4a67599721')
     def test_port_with_dns_name(self):
         name = data_utils.rand_name('port-test')
