This error message is coming a feature that was added to Drupal 8 to protect against HTTP Host header attacks.

Edit the setting.php and set the Regexp pattern :

$settings['trusted_host_patterns'] = array(
  '^www\.example\.com$',
);