A preference domain is called a non-dictatorial domain if it allows the design of unanimous social choice functions (henceforth, rules) that are non-dictatorial and strategy-proof; otherwise it is called a dictatorial domain. We study a class of preference domains called unidimensional domains and establish that within this class, the unique seconds property (introduced by Aswal, Chatterji, and Sen ( 2003)) separates non-dictatorial domains from dictatorial domains. The principal contribution of the paper is the subsequent exhaustive classification of all non-dictatorial unidimensional domains based on a simple property of two-voter rules called invariance. The preference domains that constitute the classification are semi-single-peaked domains (introduced by Chatterji, Sanver, and Sen ( 2013)) and semi-hybrid domains (introduced here) which are two appropriate weakenings of single-peaked domains and which, importantly, are shown to allow strategy-proof rules to depend on non-peak information of voters' preferences. As a refinement of the classification, single-peaked domains and hybrid domains emerge as the only unidimensional domains that force strategy-proof rules to be determined completely by the peaks of voters' preferences.