• Post Reply Bookmark Topic Watch Topic
  • New Topic

validating domain names  RSS feed

 
amus manj
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any java built-in to verify if a domain name is valid.
InetAddress() has some, but not the right one to be used on domain name.
Eg: getByName() fails to verify if sun.com is a valid domain name.

I am looking for both validating the allowable characters for the domaain and also making sure that the domain actually exists.
For the first part, I could use java.util.regex and validate, but how to ensure that the domain is reachable too.
[ August 10, 2005: Message edited by: amus manj ]
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean check if the format of the name is valid or whether the domain actually exists ?

J
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amus, you appear to have selected not to receive private messages, so I can't reply to the private message you sent me. So I'll post it in here, as other people may also have opinions on your question.
I am looking for both validating the allowable characters for the domaain and also making sure that the domain actually exists.
For the first part, I could use java.util.regex and validate, but how to ensure that the domain is reachable too.


I think the only way to check if a domain is reachable is to try to connect to it, as there are all sorts of reasons why it may not be available - doesn't exist, server down, network down, etc.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!