I just bought minecraft yesterday and when I tried to play online, I got the error saying Can't resolve hostname, I tried several IPs and nothing worked, I checked the spelling several times, after that I gave my account to my brother to see if it worked and when he tried it on his computer, it connected with no problems, but when I try it on my computer I get the error , I tried several (if not every) solutions I saw on the internet and nothing works, and I can't make it work, I deleted everything (even the .minecraft in %appdata% and reinstalled it four or five times, I even reinstalled java, I tried everything, I changed some things in my wifi parameters according to many sites and nothing works ( I changed it back when I noticed no change whatsoever ), I can play offline perfectly , I even dowloaded a map from the internet and I could play in it offline, but whenever I try to connect to any server, Can't resolve hostname, Although my brother can connect to them, so the servers are up and running just fine.
Help me please, I want to play minecraft online so bad, I keep daydreaming when watching some videos on youtube.
When you start up your minecraft launcher does it say "Play in offline mode" or "Play" because when you click the button while it says "Play" then your playing online but if your clicking "play in offline mode" your playing offline.
Another problem is your firewall or antivirus is blocking minecraft from connection to servers. Either trust MC to your firewall or antivirus or disable your antivirus.
One more suggestion is when typing a server add :25565 at the end. For example play.randomserver.com:25565.