Does InfinityFree support PHP DNS TXT lookups using dns_get_record()?

Website URL

https://danmicu-edu.ct.ws/danmicu_staging/

Error Message

Hello InfinityFree team,

I am developing a PHP application hosted on InfinityFree.

I need to implement domain ownership verification using DNS TXT records.

Could you please confirm:

  1. Is PHP’s dns_get_record() function enabled on InfinityFree hosting?
  2. Is the DNS_TXT record type supported?
  3. Are outbound DNS TXT lookups permitted from PHP scripts?

Thank you.

Other Information

We need to establish whether InfinityFree supports PHP DNS TXT lookups without exposing a diagnostic page publicly. We can do that through the hosting provider’s support channel.

Please check whether your InfinityFree account has a support/ticket option. Don’t change any hosting settings yet.

Welcome to the InfinityFree community forum! Good to have you here.

  • Most people answering here are volunteers. They’re often the fastest source of help. Admin (the only staff member) checks in about once a day for issues on our end.
  • Volunteers can’t see your account or website. Share what you actually see, like error messages and what happens when you try something. That’s more useful than your theory of what’s wrong.
  • AI tools often get InfinityFree wrong. If a volunteer’s advice differs from what an AI told you, please try the volunteer’s suggestion first.
  • Solving an issue is a joint effort. Try the suggestions you get and report back what happened.

Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look.

I couldn’t find anything in the knowledge base or on the forum that says whether dns_get_record() is enabled on InfinityFree. I also found nothing on DNS_TXT lookups. So I can’t confirm any of your three questions.

Support tickets only exist for account suspensions, so this has to be handled here on the forum. You don’t need a public diagnostic page to find out. You could upload a small PHP file, run it once, post only the output here, and then delete the file. Calling function_exists('dns_get_record') and then dns_get_record('example.com', DNS_TXT) will show whether the function exists and whether it returns records or an error. That would give a definite answer for your account.

The closest article I found covers outbound connections from PHP scripts. It only describes which ports and services are allowed for connections like cURL and fsockopen(), and it doesn’t mention DNS lookups.

Thank you for checking.

My staging application directory is protected by an .htaccess rule containing Require all denied, so I cannot access a diagnostic PHP file through the browser.

I do not want to remove this protection or expose a public diagnostic page.

Is there another safe way to test whether dns_get_record() and DNS_TXT lookups work on my InfinityFree account?

Thank you.

Just try it? Grab a domain that has a TXT record, and put up a PHP one-liner that looks up the TXT record. If it returns the record, you know it works.

As far as I know the dns_get_record() function just works like you’d expect. If it doesn’t, I’d like to know so I can look into it.

So if your own analysis suggest that something isn’t work: just tell us and we’ll try to help. Don’t hide it behind an “is X supported” question when you already know it doesn’t work.