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.
Your account’s MySQL host is sql206, so the hostname you have is the right one for this account. I can’t tell from the topic why it fails, so I have two questions.
Is the PHP script running on your InfinityFree site (the chungkhoanvn.42web.io address), or on your own computer or another host? The error is the same either way, but the cause is different, and your DNS checks only tell us what your own network sees. Where did you see the error: on the live site, or when running the code locally?
Also, can you paste the line in your code where the hostname is set? Another user got this exact “getaddrinfo failed” error even though the hostname looked correct. The cause was a trailing space inside the quoted hostname string in the code:
It might not be your problem, but your post can’t rule it out. Your code line would show whether the hostname has extra characters.
I found nothing that says the sql206 hostname has moved or has a DNS fault. If the script runs on your InfinityFree site and the hostname in the code is exactly sql206.infinityfree.com with no stray characters, then a person needs to look at this one.
I checked your account and I saw you uploaded a little database connection script. I access it, and it said everything was fine: the database hostname resolved, and the database connection was successful.
So that works as intended.
If you’re trying to access it from outside of our hosting, that’s not possible, like @KangJL already said.