How to check if a website is registered?

Asked

Viewed 857 times

0

How can I check if a particular domain (DNS) is available for registration? Basically what I need is to do a WHOIS query. I will make this query in PHP.

  • Try to edit your question in order to make it clear that you want to implement on your site a field that checks the availability of a site registration, and if possible the language you prefer to check this. Because in the way it is, it seems that you are looking for a website to check if you can register a domain.

  • Check if it is registered where (only in Brazil, etc)? There is some special reason for you to rebuild this type of service and not use the existing service(s) (like https://registro.br/cgi-bin/whois/)?

  • 2

    To have a safe search, you will need to consult this list of registrars here: https://www.internic.net/alpha.html - As it stands, the question is "too wide" in my view. I would suggest restricting the focus of the problem.

  • One solution would be for you to choose Tlds that you actually need to consult.

  • 1

    Honestly, so far I have not understood the 'no' vote, but everyone votes as they please. And if you notice I may not have used the right words, but what I needed was this WHOIS query. Thank you to everyone who helped.

  • 2

    I did not vote negative, but I understand that the problem of the question is to be too broad. There is no universal "whois" for this type of consultation. It was when everything was registered in one place. Today things have changed, see my comments above.It would help if you defined at least the scope of the research.

Show 1 more comment

2 answers

4


Maybe what you need is a WHOIS query.

There is a library called https://github.com/regru/php-whois using a range of services for consultation https://github.com/regru/php-whois/blob/master/src/Phois/Whois/whois.servers.json

Example of use:

<?php
require_once 'vendor/autoload.php';

$sld = 'dominio.com.br';//Dominio que quer verificar

$domain = new Phois\Whois\Whois($sld);

if ($domain->isAvailable()) {
    echo 'Domínio disponível';
} else {
    echo 'Domínio indisponível';
}

Although not mentioned in the repository, it requires.

However if you are not using Composer, in the case of this specific repository you can try to download the https://github.com/regru/php-whois/archive/master.zip and copy the folder src for your project then make the class call so:

<?php
require_once 'src/Phois/Whois/Whois.php';

$sld = 'dominio.com.br';//Dominio que quer verificar

$domain = new Phois\Whois\Whois($sld);

if ($domain->isAvailable()) {
    echo 'Domínio disponível';
} else {
    echo 'Domínio indisponível';
}

3

You are referring to having the domain registered in competent bodies such as.br registration or to the site being already published?

If it’s domain registration issues, the "whois" command does this, presenting (if available) information about the domain owner, date of registration, expiration, etc...

Already to check if the site is published and online, there are services like the Down For Everyone Or Just Me that show the current status of the site, whether it is online or offline.

  • I am referring to the user entering any address and knowing if it is a free domain for him to register or not. But I need to create my own search engine and not go on another site and know understood?

  • You can then use the "whois" command as said earlier: $ whois stackoverflow.com [Query whois.Verisign-grs.com] [Redirected to whois.name.com] [Query whois.name.com] [whois.name.com] Domain Name: STACKOVERFLOW.COM Registry Domain ID: 108907621_DOMAIN_COM-VRSN Register WHOIS Server: whois.name.com Register URL: http://www.name.com Updated Date: 2015-11-26T17:58:30Z Creation Date: 2003-12-26T19:18:07Z However, if we refer to stacklowoverf.net.br [whois.registro.br] % 2016-03-23 10:48:04 (BRT -03:00) % No match for Domain "stackoverflow.net.br" [/pre]

  • Sorry, I accidentally pressed "Enter" earlier while editing the answer. the "whois" command is native to most Linux distributions, as for Windows, I’m not sure. link=http://www.lhost.uol.com.br/faq/dominios/o-que-e-whois.html#rmcl

  • 3

    I have not tested, but this is the first result of a search made in Google by the term "php whois":https://github.com/regru/php-whois - there are several other available examples.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.