Check your wifi. If that isn't the problem, retype the ip, letter by letter. If it still doesn't work, re-log into Minecraft.
The reason why it does this is probably that you simply shut off the computer with Minecraft still open. I don't know why, but if I close my Mac and re-open the lid, all my servers say "Cannot Resolve Hostname" When I re-log into Minecraft, I can join my servers.