We analyze several possibilities to prescribe boundary conditions in the context of immersed boundary methods. As basic approximation technique we consider the finite element method with a mesh that does not match the boundary of the computational domain, and therefore Dirichlet boundary conditions need to be prescribed in an approximate way. As starting variational approach we consider Nitsche's methods, and we then move to two options that yield non‐symmetric problems but that turned out to be robust and efficient. The essential idea is to use the degrees of freedom of certain nodes of the finite element mesh to minimize the difference between the exact and the approximated boundary condition.