Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Simple library for getting the domain part of a hostname.

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 resources
Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README
Octocat-spinner-32 project.clj


This simple library gives you the domain for a hostname. It is based on the list of domains from

For example:

(ns my-ns
 (:require [url_dom.core :as u]))

(u/parse "")
;=> {:public-suffix "", :domain "", :rule-used "*.uk"}

Or, using the class:

(ns my-ns
  (:import ( URI)))

(domain (URI. "")) ;=> ""
(public-suffix (URI. "")) ;=> ""

If you are trying to follow the code, look at this page:

The code uses the same terminology. I don't use algorithm specified on that site, as it doesn't make all the tests pass.

Things I'll do next:

  • Upload to clojars. make sure installation and usage is straightforward.
Something went wrong with that request. Please try again.