diff --git a/src/freedombone-app-riot b/src/freedombone-app-riot
index c49d20565b93c74d20e2772d9844f65a8cdb0df7..27717dd2e1b1274eb4ae7976ac93fc5124d38273 100755
--- a/src/freedombone-app-riot
+++ b/src/freedombone-app-riot
@@ -202,6 +202,11 @@ function upgrade_riot {
     read_config_param ONION_ONLY
     riot_set_default_homeserver
 
+    read_config_param MATRIX_DOMAIN_NAME
+    riot_config_file="/var/www/${RIOT_DOMAIN_NAME}/htdocs/config.${RIOT_DOMAIN_NAME}.json"
+    sed -i "s|\"default_hs_url\":.*|\"default_hs_url\": \"https://${MATRIX_DOMAIN_NAME}\",|g" "$riot_config_file"
+    sed -i "s|\"default_is_url\":.*|\"default_is_url\": \"https://${MATRIX_DOMAIN_NAME}\",|g" "$riot_config_file"
+
     systemctl restart nginx
 }