The interaction of a current-driven domain wall with an anisotropy boundary in nanowires with perpendicular magnetic anisotropy is investigated. A local reduction of the anisotropy constant is used to create an artificial boundary where the domain wall gets pinned. Micromagnetic simulations and analytical calculations, based on a one-dimensional model, are employed to describe the interaction of the domain wall and the anisotropy boundary and to determine the depinning current densities. Two different pinning regimes-an intrinsic and an extrinsic-can be identified in dependence with the characteristic of the boundary. A very good agreement between simulated and analytically obtained data is achieved.