A reconfigurable intelligent surface (RIS) can control the wireless propagation environment by modifying the reflected signals. This feature requires channel state information (CSI). Considering the dimensionality of typical RIS, CSI acquisition requires lengthy pilot transmissions. Hence, developing channel estimation techniques with low pilot overhead is vital. Moreover, the large aperture of the RIS may cause transmitters/receivers to fall in its near-field region, where both distance and angles affect the channel structure. This paper proposes a parametric maximum likelihood estimation (MLE) framework for jointly estimating the direct channel between the user and the base station and the line-of-sight channel between the user and the RIS. A novel adaptive RIS configuration strategy is proposed to select the RIS configuration for the next pilot to actively refine the estimate. We design a minimal-sized codebook of orthogonal RIS configurations to choose from during pilot transmission with a dimension much smaller than the number of RIS elements. To further reduce the required number of pilots, we propose an initialization strategy with two wide beams. We demonstrate numerically that the proposed MLE framework only needs 6-8 pilots when conventional non-parametric estimators need 1025 pilots. We also showcase efficient user channel tracking in near-field and far-field scenarios.