Hi, I have a site that the webserver needs to be on one machine but the mail server on another. is this possible and if so, how? Thanks in advance.
This is surely possible and quite common. Your website relies on your domain name's A records while mail is delivered according to your MX records. Depending on who controls the DNS servers for your domain, you can set both of them to point to different servers. Off course, you will have to setup the appropriate service on those servers (i.e. a mail server and a web server). The key here is DNS.
Ok, that makes sense. So if setup the domain to have 4 nameservers, 2 for server one, 2 for server two. Removed the MX record from server one, the webserver and only added the MX record to server two, that would work?
You just need 2 nameservers, one of which is the primary server and the other the secondary, both of them serve exactly the same records. Usually, these are already setup by the registrar/domain host, though I prefer to manage my own. These servers contain records for your whole domain so you don't need additional servers if you have more web, mail or FTP servers on the same domain. You would configure the servers such that the entries look something like this on both servers (in addition to other parameters like the serial number, timeout settings etc.): @ IN MX 10 mail @ IN MX 20 backupmail.example.com. www IN A 192.168.0.2 ftp IN A 192.168.0.3 mail IN A 192.168.0.4 ... and so on. This is just an example and the MX record with the lowest priority (10 in this case) would be your primary mail server. If you're managing DNS via a web interface, things may be even simpler.
You should have the same information on all nameserver. Also you may do something like this domain.com. 14400 IN MX 0 mail.domain.com. mail 14400 IN A Ip_server_mail domain.com. 300 IN A ip_server_web www 14400 IN A ip_server_web