Easy PHP Script to check domain availability

So you are looking to check if your domain or others are available?

Check out our snippet from below and you can easily do that.

Here is some more information about it. Enjoy!

We are going to look at a very simple php snippet that lets you know if a specific domain is registered / available for purchase or not.

You could expand / grow this snippet and make your own website that checks websites domains for availability. To check if a domain is registered or not we will use theĀ checkdnsrr function that PHP provides us.

This function searches for the DNS records of the specific website / domain and if they aren’t available that means the domain isn’t registered.

Here is a simple, lightweight php snippet to check Domain availability:

All you need to do is replace the value of theĀ $domain variable with the one you want to check and you’re good to go.

For this example, the result / output is: grohsfabian.com is already registered !

 

Grohs Fabian

I'm a 21 year old developer from Romania who is always on the grind. Find me on my Instagram @ Motivational.Coder and on Twitter @ grohsfabian

 

Leave a Reply

Your email address will not be published. Required fields are marked *