To Validate FQDN using nslookup

shaik siddik
Tera Contributor

I have a requirement like i need to validate fqdn field on the catalog form which is string type.

EX: www.google.com - need to show true

www.sqrfgtt.com - need to show false

I thought of using sn_dns.DNSResolver class but it is not working. 

Can we use any method or command to get nslookup results or any other way guide me please.

 

 

Thanks in advance!!

 

2 REPLIES 2

Selva Arun
Mega Sage
Mega Sage

Hi Shaik,

 

If I were you, I would use an on Change client script to validate the input using the regular expression.


Here’s a Basic regular expression that can be used to validate an FQDN:

^(?!-)[A-Za-z0-9-]{1,63}(?<!-)\.(?!-)[A-Za-z0-9-]{1,63}(?<!-)\.(?!-)[A-Za-z0-9-]{2,63}(?<!-)$

 

Please check https://regexr.com/ website for more information.

If you believe the solution provided has adequately addressed your query, could you please **mark it as 'Helpful'** and **'Accept it as a Solution'**? This will help other community members who might have the same question find the answer more easily.

 

Thank you for your consideration.

 Selva

 

Validating the format of fqdn like it contains '.com' i have done. But they are asking to check is it valid IP or not.

if we give 'google.com' since it is a valid one it won't be issue but user will enter whatever he wants in place of google which is not valid one.