X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/zone/blobdiff_plain/7d593efdac74772541cd65e959a890a70ffd8e97..51a6847e534bc908f97f068c5ed82ed11c85ce15:/net.lisp?ds=sidebyside diff --git a/net.lisp b/net.lisp index d957f53..64c796d 100644 --- a/net.lisp +++ b/net.lisp @@ -259,17 +259,20 @@ (defun ipnet-changeable-bytes (mask) (defun resolve-hostname (name) "Resolve a hostname to an IP address using the DNS, or return nil." #+cmu (let ((he (ext:lookup-host-entry name))) - (and he - (ext:host-entry-addr he))) - #-cmu nil -) + (and he (ext:host-entry-addr he))) + #+clisp (let ((he (ext:resolve-host-ipaddr name))) + (and he (string-ipaddr (car (ext:hostent-addr-list he))))) + #+ecl (nth-value 2 (ext:lookup-host-entry name)) + #-(or cmu clisp ecl) nil) (defun canonify-hostname (name) "Resolve a hostname to canonical form using the DNS, or return nil." #+cmu (let ((he (ext:lookup-host-entry name))) - (and he - (ext:host-entry-name he))) - #-cmu nil) + (and he (ext:host-entry-name he))) + #+clisp (let ((he (ext:resolve-host-ipaddr name))) + (and he (ext:hostent-name he))) + #+ecl (nth-value 0 (ext:lookup-host-entry name)) + #-(or cmu clisp ecl) name) ;;;-------------------------------------------------------------------------- ;;; Host names and specifiers.