We consider the problems of finding optimal identifying codes, (open) locating-dominating sets and resolving sets (denoted Identifying Code, (Open) Locating-Dominating Set and Metric Dimension) of an interval or a permutation graph. In these problems, one asks to distinguish all vertices of a graph by a subset of the vertices, using either the neighbourhood within the solution set or the distances to the solution vertices. Using a general reduction for this class of problems, we prove that the decision problems associated to these four notions are NP-complete, even for interval graphs of diameter 2 and permutation graphs of diameter 2. While Identifying Code and (Open) Locating-Dominating Set are trivially fixed-parameter-tractable when parameterized by solution size, it is known that in the same setting Metric Dimension is W [2]-hard. We show that for interval graphs, this parameterization of Metric Dimension is fixed-parameter-tractable. * A short version of this paper, containing only the results about location-domination and metric dimension, appeared in the proceedings of the WG 2015 conference [28].pair in X has a vertex in S (totally) separating it. We have the three key definitions, that merge the concepts of (total) domination and (total) separation:Definition 1 (Slater [52,53], Babai [3]). A set S of vertices of a graph G is a locating-dominating set if it is a dominating set and it separates the vertices of V (G) \ S.