The paper describes a method for the synthesis of the electrostatic field corresponding to the potential of boundaries of an unknown shape. The proposed algorithm makes it possible to determine the optimal boundary structure of the region where it is necessary to obtain a specified electrical field distribution. The main idea is based on the application of one of the regularisation methods for solving the ill-conditioned, under-determined algebraic system of equations resulting from the application of the finite-element method. Numerical calculations performed in an example demonstrate all the features of the proposed method.