Dielectric spectroscopy was applied to investigate the dynamic properties of liquid crystal octylcyanobiphenyl (8CB) confined in 2000 Å cylindrical pores of Anopore membranes with homeotropic and axial (planar) boundary conditions on the pore walls. Homeotropic boundary conditions allow the investigation of the librational mode in 8CB by dielectric spectroscopy. We found that the dynamics of the librational mode is totally different from the behavior observed in investigations of relaxation due to reorientation of molecules around their short axis. The interpretation of the temperature dependence of relaxation times and of the dielectric strength of the librational mode needs the involvement of the temperature dependence of orientational order parameter. For samples with axial boundary conditions, layers of LCs with different thickness were obtained on the pore walls as a result of controlled impregnation of porous matrices with 8CB from solutions of different liquid crystal concentration. The process due to rotation of molecules around their short axis with single relaxation time observed for bulk 8CB is replaced by a process with a distribution of relaxation times in thin layers. This relaxation process broadens with decreasing layer thickness.