Using sed regular expression to extract domain name from file
When processing tabular data in columns, awk is often a more appropriate tool to use.  The equivalent command would be

awk '{ sub("\.$", "", $NF); print $NF }' test


… which I think is more readable.

Explanation:


NF is the number of fields: for this text, 5.
$NF is the content of the last (5th) field.
sub("\.$", "", $NF) strips the trailing dot from the last field.
{ commands } executes the commands for every line in the file.