Added option to specify the domainname.