code: public static String revertDomainName(final String domainName) {
          if (StringUtils.isBlank(domainName)) {
              throw new SwidException("domainName isn't defined");
          }
  
          try {
              URI uri = new URI(StringUtils.prependIfMissing(domainName, "http://", "https://"));
              String hostName = StringUtils.removeStart(uri.getHost(), "www.");
  
              String[] domainNameSplit = StringUtils.split(hostName, ".");
              CollectionUtils.reverseArray(domainNameSplit);
              return StringUtils.join(domainNameSplit, ".");
          } catch (URISyntaxException e) {
              throw new SwidException("Cannot revert domain name");
          }
      }
docs: <p>
  Revert given URL according to the <a href="http://en.wikipedia.org/wiki/Reverse_domain_name_notation">Reverse
  domain name notation</a>
  </p>
  <p>
  
  @see <a
  href="http://en.wikipedia.org/wiki/Reverse_domain_name_notation">http://en.wikipedia.org/wiki/Reverse_domain_name_notation</a>
  </p>
  
  @param domainName
  the domain name to be reverted
  @return reverted domain name