Popup for users outside of US and Canada

How viable is it to have users that are outside of the US and Canada reliably detected by IP address? What we are thinking is to have a popup that alerts users outside of US/Canada that they will have to buy from a distributor, but we do not want this popup inadvertently showing for people that are, actually, from the US/Canada.

Is this possible?