An analytical formulation of the nodal forces induced by a dislocation segment on a surface element is presented. The determination of such nodal forces is a critical step when associating dislocation dynamics simulations with continuum approaches to simulate the plastic behaviour of finite domains. The nodal force calculation starts from the infinite-domain stress field of a dislocation and involves a triple integration over the dislocation ensemble and over the surface element at the domain boundary. In the case of arbitrary oriented straight segments of dislocations and a linear rectangular surface element, the solution is derived by means of a sequence of integrations by parts that present specific recurrence relations. The use of the non-singular expression for the infinite-domain stress field ensures that the traction field is finite everywhere even at the dislocation core. A specific solution is provided for virtual semi-infinite segments that can be used to enforce global mechanical equilibrium in the infinite domain. The proposed model for nodal forces is fully analytical, exact and very efficient computationally. A discussion on how to adapt the proposed methodology to more complex shape functions and surface element geometry is presented at the end of the paper. © 2014 IOP Publishing Ltd.