changes logic from tenants_ips to tenants_domains

Change-Id: Iecd65143e543ddcfe4f0a5398b8ad9a187faf5da