Something like this:
TLD = ('.com', '.info', '.org', '.net')
hostName = raw_input(":").lower()
while not hostName.endswith(TLD):
print "Incorrect input, Try again!"
hostName = raw_input(":").lower()
Demo:
:foo.bar
Incorrect input, Try again!
:google.in
Incorrect input, Try again!
:yahoo.com