How to Write a code On If Domain Names are availale or not.Please help me

We are developing a site Web Hosting Services. This site provides Sell the Domain names.
my site has Create a html page this page one search utton is available.Click the search Button then displayes the Domain names are availble are not.

Note::How to search If Domain names available or not.Please Send the Script.

Please i need the script.If any Body Knows tell me.

thanking you your suggession.