Updated to determine config from host domain and handle multiple addresses and domains