The dynamic analysis of a foundation pile on a two-parameter elastic soil is performed, in the presence of non-classical boundary conditions. The soil discontinuities are simulated through the introduction ofnstep variations of the cross-section, whereas the partial restraints at the top and at the bottom are taken into account by imposing non-classical boundary conditions. Finally, the pile is supposed to be subjected to a conservative axial load at the tip. The analysis can be considered to be exact, in the framework of the Euler–Bernoulli hypothesis, the differential equation of motion is deduced and solved, and the frequency equation is derived for an arbitrary number of steps. Some numerical examples complete the paper.