Skip to content
master
Switch branches/tags
Go to file
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
Jul 22, 2015

README.md

regdom4j - Detect registered domain library for Java

regdom4j is registerd domain detector for Java. This library using public suffix list. Original implementation is reg-dom-libs.

Download

Command Line Usage

$ java -jar regdom4j.jar www.sub.example.com
> example.com

$ java -jar regdom4j.jar www.sub.example.co.jp
> example.co.jp

$ java -jar regdom4j.jar www.sub.example.shinagawa.tokyo.jp
> example.shinagawa.tokyo.jp

Library Usage

import jp.co.osstech.regdom4j.RegDomain;
...
RegDomain regdom = new RegDomain();
String result = regdom.getRegisteredDomain("www.example.com");

Return Values

  1. null if argument is a effective TLD
  2. The registered domain name if effective TLD is known

Generating Effective TLD Database

$ wget -O effective_tld_names.dat "http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1"
$ java -cp regdom4j.jar jp.co.osstech.regdom4j.GenerateEffectiveTLDs effective_tld_names.dat > src/main/resources/effectiveTLDs.xml

Auther

HAMANO Tsukasa hamano@osstech.co.jp

License

Apache License, Version 2.0

http://www.apache.org/licenses/LICENSE-2.0

About

Detect registered domain library for Java

Resources

Packages

No packages published

Languages