Should show an error message if they enter invalid domain name.
How far do you want to take this? For example, what jwmollman posted does not allow .museum. It does allow .xx which is not a valid extension (yet). I advise to fully read the second linke stbuchok provided. What about arabic domains?