Skip to content
Simple library for getting the domain part of a hostname.
Clojure Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


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.