check for domain existence before doing any ID work

Bug 1223036

Change-Id: Ie263160b2c75732b13fdbf440b4f2f31ea70d245
Merge "check for domain existence before doing any ID work"