DOMAIN
(and the other URL-handling functions in legacy SQL) have a number of limitations, unfortunately. While we don't have an equivalent yet in standard SQL (uncheck the "Use Legacy SQL" box under Options), you can make up your own that works in more cases using a regular expression. There are a number of StackOverflow questions about domain extraction, and we can put one of the answers to use as:
CREATE TEMPORARY FUNCTION GetDomain(url STRING) AS (
REGEXP_EXTRACT(url, r'^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n]+)'));
WITH T AS (
SELECT url
FROM UNNEST(['WWW.FOO.COM.AU:8080', 'google.com',
'www.abc.xyz', 'http://example.com']) AS url)
SELECT
url,
GetDomain(url) AS domain
FROM T;
+---------------------+----------------+
| url | domain |
+---------------------+----------------+
| www.abc.xyz | abc.xyz |
| WWW.FOO.COM.AU:8080 | WWW.FOO.COM.AU |
| google.com | google.com |
| http://example.com | example.com |
+---------------------+----------------+