diff --git a/src/components/structures/login/Login.js b/src/components/structures/login/Login.js
index d9a7039686..315a0ea242 100644
--- a/src/components/structures/login/Login.js
+++ b/src/components/structures/login/Login.js
@@ -230,6 +230,12 @@ module.exports = React.createClass({
switch (step) {
case 'm.login.password':
const PasswordLogin = sdk.getComponent('login.PasswordLogin');
+ // HSs that are not matrix.org may not be configured to have their
+ // domain name === domain part.
+ let hsDomain = url.parse(this.state.enteredHomeserverUrl).hostname;
+ if (hsDomain !== 'matrix.org') {
+ hsDomain = null;
+ }
return (