add domain support to toggle

Not ready for merge yet, just review.