WWW is returning Cannot connect to Destination host, when I know the host is reachable

I recently moved a database for a game I’m working on from my local machine to an online database hosted by GoDaddy. The php files and the database itself has all been moved. About half of the php files are run properly and work great, but a few of them keep returning network errors and I’m not sure why. I’ve checked to make sure I’m entering the URLS properly and can’t find anything like that. Maybe I just need another set of eyes to see mistakes I’m not noticing.
Here is the declaration of the URL

 public string userTableUrl = "http://assassintag.com/getUserData.php";

Here is where the URL is being utilized

//Purpose: put the game in the users list of games they are participating in
//Parameters: none
//Returns: an IEnumerator
IEnumerator addGameToUser()
{
	WWWForm userForm = new WWWForm();

	userForm.AddField("userPost", PlayerPrefs.GetString("user"));
	userForm.AddField("gamePost", gameName.text);
	userForm.AddField("adminPost", "true");
	using (UnityWebRequest www = UnityWebRequest.Post(addGameUrl, userForm))
	{
		www.chunkedTransfer = false;
		yield return www.SendWebRequest();

		if (www.isNetworkError)
		{
			Debug.Log(www.error);
		}
		else
		{
			Debug.Log("POST successful!");
		}
	}
}

and finally, here is a picture of the files on the file manager

Well it’s difficult to say what might be wrong here. Keep in mind that most servers are Unix based and do have case sensitive files names unlike windows. That’s a common issue when moving to a unix / linux server that the capitalisation of file or folder names could cause issues.

Apart from that you should check if your server actually allows “http” connections. Maybe you need to use “https”?

Next is you don’t cover all errors you could get. isNetworkError covers only network errors but no http errors. You usually just read the “error” property and see if it’s null or not. The property literally does this internally:

public string error
{
    get
    {
        if (!this.isNetworkError && !this.isHttpError)
            return null;
        else
            return UnityWebRequest.GetWebErrorString(this.GetError());
    }
}

So you usually just do something like this:

yield return www.SendWebRequest();
string error = www.error;
if (error != null)
{
    Debug.Log(error);
}
else
{
    Debug.Log("POST successful!");
}

The DNS resolution shouldn’t really be any issue if other files are working. The DNS lookup is only responsible for resolving the “host” part of your URL with an actual IP address to connect to. If you do a ping yourServerDomain.com in the console it should resolve the IP of your server. If that works the DNS is working fine.

Finally what may also cause issues are some sort of bot protection of certain rented servers. Some servers (which are only meant for websites) often apply a redirect to some sort of landing page with a piece of javascript code to verify this page is shown in a browser. Automatic redirects are usually silently handled by Unity’s webrequest. However you can never know what else may go wrong.

I strongly recommend to install WireShark and record your request attempt. Keep in mind when using wireshark you either need to use a good filter (which is often difficult) or shut down as many applications that could cause network traffic (this is usually the best approach). So things like skype, steam, dropbox, any kind of browser should be closed.

Wireshark is free and can be obtained from www.wireshark.org

I’ve discovered that when my local server is on, everything defaults to that. I flushed my dns, but its not working still.