Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning for mapped domain with wrong NS config #3329

Merged
merged 16 commits into from
Aug 15, 2016

Conversation

umurkontaci
Copy link
Contributor

@umurkontaci umurkontaci commented Feb 16, 2016

This fixes #3152.

Goes with D2003-code.

There's a bug where mapped domain notices don't work, fix in #6983 and D2348-code.

This adds a warning notice when you buy a mapped domain but don't update the nameserver records to point to our name servers.

There are three place where this appears:

  1. My site sidebar
  2. Domain Management -> Domain List
  3. Domain Management -> Domain Details

@ranh or @breezyskies: I had to change GridIcon size from 16 to 18 (It wouldn't let me commit), fyi.

Screenshot:

image

Testing:

  • Get a new mapped domain
  • Confirm you see the warning on 3 places aforementioned.
  • Configure your NS records to point to WordPress name servers
  • Confirm the message is gone or you can compare it with an already configured domain.

PS: Although we'd like the message to visible to make people configure their site, there are some legitimate (albeit not endorsed by us) ways to get a mapped domain working without changing NS records. So there's a slight chance that seeing this message everywhere might be annoying for some.

/cc: @klimeryk @aidvu for code
/cc: @ranh @breezyskies for copy and ideas on ^

@umurkontaci umurkontaci added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Status] Needs Design Review Add this when you'd like to get a review / feedback from the Design team on your PR [Feature Group] Emails & Domains Features related to email integrations and domain management. labels Feb 16, 2016
@umurkontaci umurkontaci self-assigned this Feb 16, 2016
@umurkontaci umurkontaci force-pushed the fix/3152-mapped-domain-ns-warning branch from 1dfe3bd to 13fef8a Compare February 16, 2016 00:44
const wrongMappedDomains = this.getDomains().filter( domain =>
domain.type === domainTypes.MAPPED && ! domain.hasZone );

let learnMoreLink = ( <a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we don't need this learnMoreLink variable. It's only used once below.

@ranh
Copy link
Contributor

ranh commented Feb 16, 2016

The issue of configuring name servers for domains mapped to a WordPress.com site is a bit complicated, I'm not sure this notice addresses that.

There are several use cases that I think could use special attention:

  • Newly mapped domain, name servers not yet configured. If name servers are not set up correctly when a domain was just added, it's not really an error, it should be seen as an integral part of the flow, like in the screenshot from wp-admin in Domains: Show warning for mapped domains when NS records are not set to WordPress name servers. #3152.
  • Existing mapped domain that used to work correctly with wpcom name servers, but name servers suddenly changed. This could make a site unavailable so if it's done by accident it's an urgent issue, we should contact user directly about it and show a notice like "your site may be offline".
  • Existing mapped domain, name servers intentionally set to point outside of WordPress.com as a way to redirect the site outside. This is normal and we shouldn't show a notice at all. Using the Domain Mapping upgrade with non-wpcom nameservers used to be the recommended way to redirect your site, before we started offering the Site Redirect upgrade. There might still be plenty of users with domain mapping upgrades set up to work like that.

Otherwise, the format of the notice could be a bit problematic. We can only show a very short message here, and we don't have a complete flow to address the issue, we're just pointing to a support doc from what I can tell.

We could address this by creating a support doc dedicated to this notice, so that it would fill in for the missing flow. That could help people get the right idea even if they don't immediately understand what it means that their "name servers should be configured".

This notice might work with that:

Your domain "example.com" may not be set up correctly. Learn more.

This doesn't really address the issues mentioned above. But it could at least make for a better notice.

@umurkontaci Let me know what you think and I can prepare a dedicated support page for this if necessary.

@umurkontaci
Copy link
Contributor Author

Newly mapped domain, name servers not yet configured. If name servers are not set up correctly when a domain was just added, it's not really an error, it should be seen as an integral part of the flow, like in the screenshot from wp-admin in #3152.

I agree that it's not an error. Ideally, this should be integrated in something like a post-purchase flow.

Existing mapped domain that used to work correctly with wpcom name servers, but name servers suddenly changed. This could make a site unavailable so if it's done by accident it's an urgent issue, we should contact user directly about it and show a notice like "your site may be offline".

I think this warrants an error notice. Although I don't think there's a way for us to know whether it worked before. We can assume this category if the domain is more than X days old and still not set up.

Existing mapped domain, name servers intentionally set to point outside of WordPress.com as a way to redirect the site outside. This is normal and we shouldn't show a notice at all. Using the Domain Mapping upgrade with non-wpcom nameservers used to be the recommended way to redirect your site, before we started offering the Site Redirect upgrade. There might still be plenty of users with domain mapping upgrades set up to work like that.

I didn't know that at all. It's impossible to differentiate this from the previous category. The only solution I can find for that is to allow people to migrate to site redirect and cancel their mapping sub; but this is way overkill for a notice.

We could address this by creating a support doc dedicated to this notice, so that it would fill in for the missing flow. That could help people get the right idea even if they don't immediately understand what it means that their "name servers should be configured".

I think this is the quick win here. It's relatively easy to differentiate between a new vs an old domain, so we can change the copy / flow for them in the future.

@ranh
Copy link
Contributor

ranh commented Feb 17, 2016

I didn't know that at all. It's impossible to differentiate this from the previous category. The only solution I can find for that is to allow people to migrate to site redirect and cancel their mapping sub; but this is way overkill for a notice.

Perhaps we can start by checking how many mapped domains currently have non-wpcom name servers set up. That would give us an idea of how many people will be affected by this when the notice first launches. We have done this analysis in the past, I'll try to look up some examples.

@klimeryk
Copy link
Contributor

Code looks good (althought depending on Ran's findings might need some reworking), but I just wanted to note that the variable wrongNSMappedDomains kinda stuck out to me (or maybe I'm weird like that), because according to our naming conventions it should be wrongNsMappedDomains. It's used a few times and just looks... weird to me 😆 It's hardly a pressing issue, just something to think about when (or if) this needs some reworking.

@umurkontaci
Copy link
Contributor Author

@ranh Let me know if I can help with that.

@umurkontaci umurkontaci added [Status] In Progress and removed [Status] Needs Design Review Add this when you'd like to get a review / feedback from the Design team on your PR [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 29, 2016
@artpi
Copy link
Contributor

artpi commented Mar 9, 2016

Where is this name server data coming from and how often is it refreshed?
Do we worry about hitting some dns query limits?

@umurkontaci
Copy link
Contributor Author

I'm not sure about how many resolvers we have, but DNS data is cached on every resolver depending on its TTL. NS records have usually very large TTLs but it definitely varies.

This approach was being used in wp-admin and I don't recall hitting any query limits. Those limits are pretty high, e.g. Google DNS supposedly has 500QPS, which makes it 43m/day.

@aidvu How about going a different way, instead of checking NS records, can we nslookup and check if it resolves to our IPs?

I think this would get rid of the issue if the users want to keep their records at somewhere else and willing to use a subdomain with a CNAME record.

@artpi
Copy link
Contributor

artpi commented Mar 10, 2016

Splendid you're working on it!
Works pretty well!

I tested it a bit and found out:

  1. I have a domain that has different NS but A recording is pointing to WP - domain working, no notice (as desired, awesome!)
  2. I have domain that has WP NS - domain working, no notice - good!
  3. I have a domain that is mapped, but different NS - domain not working, notice is showing - good!

I just added "A" record to the domain ( 3 ) with different NS, we'll see how long propagation takes and if notice will pick up on it.

Edit: domain started working on my machine after 15 minutes, still showing error in Calypso. experiment in progress.

Edit. Mapping subdomain still shows error after 2 hours. I removed it and added:
4. Mapping subdomain, different NS, via CNAME - subdomain not working yet (propagating) - notice shows error (as expected)

Edit: (4) 15 minutes passed. Domain propagated to me. Working. Notice still shows error. Will post when error is gone

Edit: still waiting for the notice do disappear

Edit: 24 hours after the site started working, the notice is still there!
What can we do about it and when should it disappear?

Edit : 4 days - notice still there! We should do something about it.

Some minor UI remarks (of course it can be for another PR):

If I have a > 1 errors:


Would be cool to list offending domains.

Here it would be cool to mark the actual domain in the card with domain (like Primary mark)

domain.type === domainTypes.MAPPED && ! domain.hasZone );

let learnMoreLink = ( <a
href="https://support.wordpress.com/domains/change-name-servers"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure this is a proper link?

The whole notice should be displayed, when domain is bought elsewhere and Name Servers should be set in the admin panel of domain provider.
The attached link shows how to point domain bought on wp.com to outside name servers.
I believe this is the link that was supposed to be here: https://en.support.wordpress.com/map-existing-domain/#2-ask-your-domain-provider-to-update-your-dns-settings

Also, we show the same link in case of subdomain, in which case we should give this link (I believe): https://en.support.wordpress.com/map-subdomain/#instructions-for-mapping-subdomains
And information about CNAME....

Also I really find the Domain Helper output being pretty helpful and a bit more in context then a general support page.

'https://en.support.wordpress.com/domain-helper/?host=' + wrongMappedDomains[0].name

@ranh
Copy link
Contributor

ranh commented Mar 13, 2016

After testing this we now know that app. 10% of mapped domains are not using WordPress.com name servers. Of course, we don't know if these domains are set up that way intentionally or not.

@umurkontaci
Copy link
Contributor Author

@ranh What is your take from the result?

@ranh
Copy link
Contributor

ranh commented Mar 23, 2016

@umurkontaci I think 10% is a significant group of users that we don't exactly understand. Maybe we could start with a more conservative approach, for example a lower key notice that is less prominent. That said, note that we're also currently sending email reminders to owners of mapped domains that are not using out name servers, and those emails also don't address the site redirect use case.

@artpi
Copy link
Contributor

artpi commented Mar 23, 2016

@ranh :

10% of mapped domains are not using WordPress.com name servers. Of course, we don't know if these domains are set up that way intentionally or not

Well, how can it even work intentionally? Something has to be wrong here.
a) the NS can be wrong
b) the domain mapping should be gone
c) User knows its wrong, but wants the mapping just in case or is afraid to delete it, or wants it for the future.

If the users are keeping the mapping "just in case", we can provide "dismiss" option for that notice, but I cannot imagine technically how keeping that mapping for the domain that points elsewhere can work.

@ranh
Copy link
Contributor

ranh commented Mar 23, 2016

I'm not sure I understand the question @artpi. See above for some of the potential use cases.

@artpi
Copy link
Contributor

artpi commented Mar 23, 2016

@ranh, my point is, that regarding your comment above:

Newly mapped domain, name servers not yet configured

We should show the notice, because users very often forget to configure NS. There is an avalanche of tickets every day and HE remind people that that they need to update NS

Existing mapped domain that used to work correctly with wpcom name servers, but name servers suddenly changed.

We should show the notice because obviously something is wrong

Existing mapped domain, name servers intentionally set to point outside of WordPress.com as a way to redirect the site outside. This is normal and we shouldn't show a notice at all

I disagree. If they did that, they should delete the mapping. The mapping is essentially ineffective and there is no indication of that anywhere.
We should show the notice and provide maybe an option to dismiss it, but we should mark the site as inaccessible, as in this PR.

My point is: in all of these cases something is misconfigured and we should inform users of that.

@ranh
Copy link
Contributor

ranh commented Mar 23, 2016

Existing mapped domain, name servers intentionally set to point outside of WordPress.com as a way to redirect the site outside. This is normal and we shouldn't show a notice at all

I disagree. If they did that, they should delete the mapping. The mapping is essentially ineffective and there is no indication of that anywhere.

Note that the domain mapping in this case is not ineffective. It is effectively equivalent to using the Site Redirect upgrade to redirect the site away from WordPress.com. It costs the same too.

I guess the ideal scenario here would be that every instance of domain mapping that is used as a site redirect is converted to an actual site redirect upgrade. But that is a big project with very vague benefits.

@artpi
Copy link
Contributor

artpi commented Mar 23, 2016

It is effectively equivalent to using the Site Redirect upgrade to redirect the site away from WordPress.com.

I am not sure about that... If my domain points to WP NS and I have a site redirect upgrade, I still can put custom settings in DNS editor:

  • email (mx)
  • subdomains
  • some other settings
    And they should work.

During support rotation I had a user that had an email in the domain that was actually mapped and then he changed NS settings, so his email stopped working and even he didnt get any information from us, because well, his email stopped working :)

I think that NS changing to point elsewhere is the most dangerous scenario of all :)

@umurkontaci
Copy link
Contributor Author

@artpi Using mapped domains instead of Site Redirect looks like this:
You have a domain called external.com, which is not tied to us or WordPress at all.
You also have a example.wordpress.com, which is a WordPress.com site and you want to retire the WordPress.com site in favor of external.com.

You have two options:

  1. Buy a site redirect for external.com. All requests coming to example.wordpress.com will now redirect to external.com.
  2. Buy a domain mapping for external.com and set it the primary domain. All requests coming to example.wordpress.com will redirect to external.com, since it is the primary domain.

Basically a mapped domain allows you to a set a specific domain as a primary domain and since we redirect requests to other domains to the primary domain, this can be used instead of a Site Redirect upgrade.

No DNS involved in this flow, it's just a HTTP redirect.

@umurkontaci umurkontaci force-pushed the fix/3152-mapped-domain-ns-warning branch from 13fef8a to 2aef0ad Compare March 29, 2016 22:44
@umurkontaci umurkontaci force-pushed the fix/3152-mapped-domain-ns-warning branch 2 times, most recently from 4a2edc2 to 6257396 Compare August 12, 2016 00:57
@umurkontaci
Copy link
Contributor Author

@klimeryk Fixed the conflicts, everything seems OK.

@klimeryk klimeryk force-pushed the fix/3152-mapped-domain-ns-warning branch from 6257396 to a8d7d99 Compare August 15, 2016 11:18
@klimeryk klimeryk added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Aug 15, 2016
@klimeryk
Copy link
Contributor

Awesome work, @umurkontaci! 👍
I've just made a small adjustment in a8d7d99 - the notice was not displayed on the domain details page (probably got lost in a merge). Other than that - looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature Group] Emails & Domains Features related to email integrations and domain management.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Domains: Show warning for mapped domains when NS records are not set to WordPress name servers.
8 participants