Click here to Skip to main content
16,020,424 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

How can i validate an input string, if it is a valid domain name (in C + Linux).

input string format may be "www.google.com" or "www.abcd.co.uk".
Posted
Updated 22-Mar-22 6:30am

1 solution

The gethostbyname()[^] function should do what you want.
 
Share this answer
 
Comments
vidiking 10-Jul-12 4:25am    
can you please tell me how to use this function?
Richard MacCutchan 10-Jul-12 5:01am    
I have given you a link to the man page, please read it.
vidiking 10-Jul-12 5:07am    
Thank you very much

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900