Domain name search

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Post by vinoth »

lets explain in detail I didn't get you..

Without any file means then how that page was displayed
Anyway the DNS will provide default files..
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post by VladSun »

A quick example:

Code: Select all

 
if (system("dig ".$domain." | grep 'ANSWER: 0,'") == "")
{
      echo "Domain exists!";
}
else
{
     echo "Domain doesn't exist!";
}
 
Last edited by VladSun on Mon Jul 05, 2010 7:07 am, edited 2 times in total.
There are 10 types of people in this world, those who understand binary and those who don't
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Post by vinoth »

fine..

It works well,

But if the Domain doesnot exits it shows the error messaage..
Is there any way to remove the system error message and display our own error..

Thanks for your suggestions
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

try using @system if its php errors you want suppressed.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post by VladSun »

TESTED: Use shell_exec() or exec() instead of system() :)
There are 10 types of people in this world, those who understand binary and those who don't
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Post by vinoth »

ya
shell_exec() and exec() will supressed the PHP errors

Its working fine now

Thanks for your suggestion..
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Re: Domain name search

Post by vinoth »

Hi all.

Now I faced the new problem on Domain name search.

for example the http://focalpoint.com/ is the site they already register but if i use shell_exec() or exec() functions, It shows the domain name not exists.

Can anyone provide suggestions or code to achieve the Domain name search function.

Thanks in Advance
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Domain name search

Post by VladSun »

No, it's not registered yet:

Code: Select all

dig http://focalpoint.com/
 
; <<>> DiG 9.3.4 <<>> http://focalpoint.com/
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 56257
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
 
;; QUESTION SECTION:
;http://focalpoint.com/.                IN      A
 
;; AUTHORITY SECTION:
.                       10800   IN      SOA     a.root-servers.net. nstld.verisign-grs.com. 2008070101 1800 900 604800 86400
 
;; Query time: 56 msec
;; SERVER: 212.72.193.50#53(212.72.193.50)
;; WHEN: Wed Jul  2 12:43:38 2008
;; MSG SIZE  rcvd: 115
 
There are 10 types of people in this world, those who understand binary and those who don't
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Re: Domain name search

Post by vinoth »

Hi VladSun,
Thanks for your reply.

When I try to register the site http://focalpoint.com/, on media Temple.
It shows an error maessage "The domain name "focalpoint.com" is unavailable".
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Re: Domain name search

Post by vinoth »

Hi.
Currently I am using fsock() function for checking the domain name.
I am not sure, How it will work on all conditions.
Can anyone confirm this?

Thanks in advance
Post Reply