Function: whois-get-tld

whois-get-tld is a byte-compiled function defined in net-utils.el.gz.

Signature

(whois-get-tld HOST)

Documentation

Return the top level domain of host, or nil if it isn't a domain name.

Source Code

;; Defined in /usr/src/emacs/lisp/net/net-utils.el.gz
(defun whois-get-tld (host)
  "Return the top level domain of `host', or nil if it isn't a domain name."
  (let ((i (1- (length host)))
	(max-len (- (length host) 5)))
    (while (not (or (= i max-len) (char-equal (aref host i) ?.)))
      (setq i (1- i)))
    (if (= i max-len)
	nil
      (substring host (1+ i)))))