BEGIN{FS=OFS="."}{print $(NF-1),$NF}
yahoo.com mail.yahoo.com a.yahoo.com
yahoo.com yahoo.com yahoo.com
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!