Assigns an id to a domain