Do I need to rebuild when my domain name changes?

you should be in /var/discourse and then run that command, be sure to have the entire command

./launcher rebuild app