module ActionDispatch::Http::URL

def extract_domain_from(host, tld_length)

def extract_domain_from(host, tld_length)
  host.split(".").last(1 + tld_length).join(".")
end