Auto sort host via location

Good Day,

Is it possible to auto sort the hosts that is registered in katello to the correct location? For example: should go to location test, should go to location dev.

I have already setup the location and the domains in foreman but think I am missing something?

In the location the domain is included of