Forums Register Login

validating domain names

+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
Do you mean check if the format of the name is valid or whether the domain actually exists ?

J
+Pie Number of slices to send: Send
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.
Beauty is in the eye of the tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1189 times.
Similar Threads
Websphere 4.0 CMP Association Problem
Validating domain name with struts validator
Why regular expressions
problem with Validating EJB module extensions
logical locking and potential for concurrent thread access
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:48:26.