Domain Mapping site admin behaving strangely

I'm not sure if this is since the last update but the site level Domain Mapping admin page (Tools > Domain Mapping) started showing several oddities.

I tried disabling all other plugins both site level and network wide but no change. I tried disabling and enabling Domain Mapping but no change.

These are the things going wrong:

1. entering a domain pointing to another IP it is still marked as valid;
2. after adding a second domain, there is not that asterix to select one as primary;
3. after refreshing the page (!) the fields "Connect Domain" and "Front end redirect should be" are gone;

What is going on?

  • RavanH
    • The Crimson Coder

    About the missing 'Connect Domain' and 'Front end redirect should be' fields: it turns out they are hidden with CSS in wp-content/plugins/domain-mapping/css/admin.css?ver=4.1.4.2

    .domainmapping-form-hidden .domainmapping-form {
        display: none
    }

    It looks like that class "domainmapping-form-hidden" being added to the wrapping div came back from an older version of this plugin that did not allow adding more than one domain... And the missing asterix would be explained by that as well. Why this reversal of new features?

  • RavanH
    • The Crimson Coder

    Hang on... I completely forgot about define('DOMAINMAPPING_ALLOWMULTI', 'yes');

    That solves the issues 2 and 3 but leaves:

    1. domains always marked as valid on most of my installations, while on one other it is always marked as invalid.

    2. 1 letter subdomain is not accepted

    3. domains with the word "status" in them are not accepted

  • Jack Kitterhing
    • Code Norris

    Hi there @RavanH,

    Hope you're well today! :slight_smile:

    Sorry to see of the issues your having here with Domain Mapping, for issues, 1, 2 & 3.

    Can you send me the following please so I can test.

    - In the subject field add "Attn: Jack Kitterhing"
    - Link back to this thread
    - Include admin/network access
    - Include FTP
    - Include a one letter subdomain I can map.
    - Include a domain with the word "status" I can try to map.
    - Include any relevant URLS for your site

    On the contact form, select "I have a different question", this ensures it comes through and gets assigned to me.

    https://premium.wpmudev.org/contact/

    Thank you!

    Kind Regards
    Jack.

  • Jack Kitterhing
    • Code Norris

    Hi there @RavanH,

    Hope you're well today! :slight_smile:

    Thanks for sending through the details, I've taken a look at that domain you sent through and it's certainly been, interesting.

    None of the DNS checking tools I tried will recognise it, this includes intodns.com and also pingdoms DNS checker.

    In the end I did manage to check and can see your using a IPv6 address, rather than a IPv4 address, I don't personally have a IPv6 address to check against, but do you have any IPv4 address you can check? :slight_smile:

    Also if you could send through access to that other install as you mentioned in the email, that would be fantastic! :slight_smile:

    Kind Regards
    Jack.

  • RavanH
    • The Crimson Coder

    Hi Jack,

    I'm surprised you cannot get an IPv4 address. It's well defined (both for main domain as for m subdomain) in the DNS records:

    $TTL 3600
    @	IN SOA dns107.ovh.net. tech.ovh.net. (2014071901 86400 3600 3600000 300)
                              IN NS     ns107.ovh.net.
                              IN NS     dns107.ovh.net.
                              IN MX 1   redirect.ovh.net.
                              IN A      37.59.121.27
                              IN AAAA   2001:41d0:51:1:0:0:0:1510
                          500 IN TXT    "1|m.etropolis.info"
    *                         IN CNAME  etropolis.info.
    _autodiscover._tcp        IN SRV    0 0 443 mailconfig.ovh.net.
    _imaps._tcp               IN SRV    0 0 993 ssl0.ovh.net.
    _submission._tcp          IN SRV    0 0 465 ssl0.ovh.net.
    m                         IN A      37.59.121.27
    m                         IN AAAA   2001:41d0:51:1:0:0:0:1510
    m                         IN TXT    "google-site-verification=M9lc8rc4tiCNti-cIMhZcG9U8BSnNWO7QorSs6Z0ZX4"

    I'll try a 'reset' and start fresh with minimal entries to see if that does the trick...

  • Jack Kitterhing
    • Code Norris

    Hiya @RavanH,

    Hope you're well today! :slight_smile:

    Thanks for the additional information, yep that's all correct, no problems there, I've done some further checks though and it looks like your missing a CNAME for m.etropolis.info?

    Could you double check that your end please in the DNS records. :slight_smile:

    Thank you!

    Kind Regards
    Jack.

  • RavanH
    • The Crimson Coder

    Hi @Jack Kitterhing - the CNAME is present. Full zone :

    $TTL 3600
    @	IN SOA dns107.ovh.net. tech.ovh.net. (2014072010 86400 3600 3600000 300)
               IN NS     ns107.ovh.net.
               IN NS     dns107.ovh.net.
               IN MX 1   redirect.ovh.net.
               IN A      37.59.121.27
               IN AAAA   2001:41d0:51:1:0:0:0:1510
               IN TXT    "1|www.etropolis.info"
    m          IN CNAME  etropolis.info.
    www        IN MX 1   redirect.ovh.net.
    www        IN A      37.59.121.27
    www        IN AAAA   2001:41d0:51:1:0:0:0:1510
    www        IN TXT    "l|fr"
    www        IN TXT    "3|welcome"
  • Jack Kitterhing
    • Code Norris

    Hiya @RavanH,

    Hope you're well today! :slight_smile:

    Very strange, that wasn't showing for me when I checked, but it is now, seems these DNS checker tools are becoming a bit unreliable.

    I've done some testing on both your site and mine, after much testing and trying to find the root cause, I can confirm that a one letter sub domain isn't accepted.

    I've notified the lead developer about this, appreciate your patience here. :slight_smile:

    Kind Regards
    Jack.

  • RavanH
    • The Crimson Coder

    Hi @Jack Kitterhing - thanks! :slight_smile:

    That leaves the strange issue where domains that point to another IP get health status "valid". If you try for instance adding the domain begoodies.fr to that test site you have access to, you will see what I mean...

  • Jack Kitterhing
    • Code Norris

    Hi there @RavanH,

    Hope you're well today and thanks for your patience here.

    For the one letter sub domain, in wp-content/plugins/domain-mapping/classes/Domainmap/Module/Ajax.php line 48 change

    change this

    && preg_match( "/^[^\.]{2,63}(\.[^\.]{2,63})+$/", $domain ); //length of each label

    to

    && preg_match( "/^[^\.]{1,63}(\.[^\.]{2,63})+$/", $domain ); //length of each label

    And see if this works for you. :slight_smile:

    Kind Regards
    Jack.

  • Jack Kitterhing
    • Code Norris

    Hi there @RavanH,

    Hope you're well today, fantastic! That change will be in a upcoming update. :slight_smile:

    This just leaves the health status issue, I noticed you had verify DNS settings off in network admin > settings > domain mapping, could you change that to yes and see if it works correctly then please? :slight_smile:

    Thanks!

    Kind Regards
    Jack.

  • RavanH
    • The Crimson Coder

    Hi @Jack Kitterhing - did that and tested a range of older existing domains, all pointing to other IP addresses, with varying results:

    ardecheweb.com > valid
    ardecheweb.net > domain unavailable to access
    ardecheweb.org > domain unavailable to access
    ardecheweb.info > valid
    ardecheweb.fr > valid
    7region.com > domain unavailable to access
    7region.net > domain unavailable to access
    7region.org > valid
    7region.info > valid
    7region.fr > domain unavailable to access

    I do not see any pattern here...

    Question: should that "Domain name is unavailable to acces." message come up when it detects a different IP setting or is this message actually reserved for domains that have not been registered or don't have any (proper) DNS records yet?

  • Jack Kitterhing
    • Code Norris

    Hi there @RavanH,

    Hope you're well today! :slight_smile:

    I've checked into this and it's interesting, it actually uses regex to check if it's a valid domain string, using the following.

    protected static function _validate_domain_name( $domain ) {
    		return preg_match( "/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i", $domain ) //valid chars check
    			&& preg_match( "/^.{1,253}$/", $domain ) //overall length check
    			&& preg_match( "/^[^\.]{2,63}(\.[^\.]{2,63})+$/", $domain ); //length of each label
    	}

    In domain-mapping/classes/Domainmap/module/Ajax.php line 44.

    Which relates to http://stackoverflow.com/questions/1755144/how-to-validate-domain-name-in-php/4694816#4694816

    The unavailable to access status, seems to be on a occasion when it incorrectly throws a false on the validation if that makes sense?

    So it should be only when they don't have the correct DNS records and the plugin can't access it, to check if it's a valid string.

    Thanks!

    Kind Regards
    Jack.

  • RavanH
    • The Crimson Coder

    Hi @Jack Kitterhing thanks for testing, relaying and keeping me informed :slight_smile:

    So is it actually a DNS thing or an issue with the regex? Or both, or none? If it is related to missing DNS entries, please let me know and I can ajust them. If not, I'll be happy to wait for "proper IP validation" :slight_smile:

  • Jack Kitterhing
    • Code Norris

    Hi there @RavanH,

    Hope you're well today! :slight_smile:

    I've checked and you don't appear to be missing any DNS records you should have for this, seems to be just a issue with it validating the domain using the regex.

    Hopefully the IP validation method won't take too much longer. :slight_smile:

    Thanks!

    Kind Regards
    Jack.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.