diff --git a/src/freedombone-app-matrix b/src/freedombone-app-matrix
index 340aadf98fc4845bb5a6c8bb84eab0c8c6419215..b96d699edad196447d81c520b9c3293b054266be 100755
--- a/src/freedombone-app-matrix
+++ b/src/freedombone-app-matrix
@@ -235,6 +235,8 @@ function matrix_configure_homeserver_yaml {
     sed -i "s|log_file:.*|log_file: \"/dev/null\"|g" "${filepath}"
     sed -i '0,/bind_address:.*/s//bind_address: 127.0.0.1/' "${filepath}"
     sed -i '0,/x_forwarded:.*/s//x_forwarded: true/' "${filepath}"
+    sed -i "s|server_name:.*|server_name: \"${DEFAULT_DOMAIN_NAME}/matrix\"|g" "${filepath}"
+    sed -i "/trusted_third_party_id_servers:/a     - ${DEFAULT_DOMAIN_NAME}/matrixid" "${filepath}"
 }
 
 function matrix_configure_identityserver {
@@ -245,7 +247,7 @@ function matrix_configure_identityserver {
     sed -i "s|Sydent Validation|Freedombone Matrix Account Validation|g" ${filepath}
     sed -i "s|pidfile.path.*|pidfile.path = /etc/sydent/sydent.pid|g" ${filepath}
     sed -i "s|log.path.*|log.path = /dev/null|g" ${filepath}
-    sed -i "s|server.name.*|server.name = ${DEFAULT_DOMAIN_NAME}|g" ${filepath}
+    sed -i "s|server.name.*|server.name = ${DEFAULT_DOMAIN_NAME}/matrixid|g" ${filepath}
 }
 
 function matrix_diff {