Let R be an integral domain and \(R^{\#}\) the set of all nonzero nonunits of R. For every element \(a,b\in R^{\#},\) we define \(a\sim b\) if and only if \(aR=bR,\) that is, a and b are associated elements. Suppose that \(EC(R^{\#})\) is the set of all equivalence classes of \(R^{\#}\) according to \(\sim \) . Let \(U_{a}=\{[b]\in EC(R^{\#}):b\) divides \(a\}\) for every \(a\in R^{\#}.\) Then we prove that the family \(\{U_{a}\}_{a\in R^{\#}}\) becomes a basis for a topology on \(EC(R^{\#})\) . This topology is called the divisor topology of R and is denoted by D(R). We investigate the connections between the algebraic properties of R and the topological properties of \(\ D(R)\) . In particular, we investigate the separation axioms on D(R), first and second countability axioms, connectivity, and compactness on D(R). We prove that for atomic domains R, the divisor topology D(R) is a Baire space. Also, we characterize valuation domains R in terms of the nested property of D(R). In the last section, we introduce a new topological proof of the infinitude of prime elements in a UFD and integers by using the topology D(R).