For an arbitrary set of distances \(D\subseteq \{0,1, \ldots, d\}\), a graph \(G\) is said to be \(D\)-distance magic if there exists a bijection \(f:V\rightarrow \{1,2, \ldots , v\}\) and a constant {\sf k} such that for any vertex \(x\), \(\sum_{y\in N_D(x)} f(y) ={\sf k}\), where \(N_D(x) = \{y \in V| d(x,y) \in D\}\). In this paper we study some necessary or sufficient conditions for the existence of \(D\)-distance magic graphs, some of which are generalization of conditions for the existence of \(\{1\}\)-distance magic graphs. More specifically, we study \(D\)-distance magic labelings for cycles and \(D\)-distance magic graphs for \(D\subseteq\{0,1,2\}\).