is there a way yo add 2 hosts per domain so if i host dies it automatically switches to the other one?
or if its slow you can easily switch to the second host?
Webmasters Stack Exchange is a question and answer site for pro webmasters. It only takes a minute to sign up.Sign up to join this community
Yes there are ways to do this but it's a fairly big topic with several different approaches.
The cheapest and simplest way to do this is with DNS. A DNS server gives the ip address of your domain when queried, you have some monitoring that detects when one of your hosts is down and tells the name server to stop giving out the ip of the broken server. normally DNS results are cached often for a day, so you need to the name server to say the record is only valid for a short time, however some isp's will ignore this and cache the record anyway. DNS was no really designed for this and it's not considered a good solution for large sites.
If your site relies on a database you need to make sure this is kept up to date on both servers or kept on a separate server. You can do master/slave database replication if the database is busy and important.
The other switching solutions are much more expensive. You can have two load balancers which distributes to several web servers, a heartbeat system monitors load balancers and the spare takes over the ip should the first fail. You can use BGP to change network routes if a server fails. You can have one ip address in several locations called multihoming.
As I said a big topic but for a small site DNS fail over is best. There are companies offering this as a service but if you have the TTL of your DNS records set low, say one hour then you may be able to change manually, this will be good enough in a lot of cases.