Under Settings -> General Settings -> Trusted Piwik Hostname there is only one field for the trusted hostname and a 'Save' button.
After some googling I discovered that I can edit
config.ini.php and add an additional
trusted_hosts = "www.example.com" line. After I did this, the dashboard displayed both domains, each on a separate line, and an 'Add' button in addition to the 'Save' button. Seems like the 'Add' button should be displayed always.
In dc4565034000a49090be52fe36b0a4842c035473: fixes #4854 always allow to add/remove new trusted hosts, even if there is only one defined in config