To Validate FQDN using nslookup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2024 05:23 AM
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!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2024 07:22 AM - edited 08-20-2024 07:24 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2024 10:31 AM
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.