TF31003: Your user account does not have permission to connect to the Team Foundation Server

My bad concience of not spreading my experience regarding this error led to this post. I noticed this strange popup error when I wanted to add a new user for accessing my Team Foundation Server. It was nothing wrong with the actual user, rather, I discovered it had something to do with accessing it from another computer. I could not even log in with my existing user from a remote computer without getting this error.

I found a solution and I have no idea if it is a good or bad fix - but it works. If someone knows that this is a stupid solution and have a better one then please tell me.

I figured out that it had something todo with the computer/domain name. So, I went into C:\Windows\System32\drivers\etc and edited the hosts-file. I added the ip and a name for that ip. I saved the file. Then I opened VisualStudio again and added that servername. The server name can be anything as long as it is pointing to the correct ip.