Connecting 2 PCs to 1 Monitor via DVI Cable

Not really sure which topic to post this under... 

Looking for the best solution to hook up 2 computers to one monitor via DVI.  Doing a little research, sounds like DVI splitters are not a quality or reliable solution.

Any suggestions.  Maybe a KVM switch?  If so, can you recommend one?

Of course, I will only be using one computer at a time, but want to be able to utilize the same monitor without having to physically move cables around depending on the computer am using.

If your monitor has more than 1 port to connect to your PC then it should be fine. Example: Your monitor could have a HDMI and a DVI, plug one PC into the HDMI and the other into the DVI.