GPS-based virtual fencing systems enclose grazing animals in a specific area without physical barriers and may thus support wildlife, facilitate targeted grazing and optimize labour efficiency in grassland management. The present study investigated whether dairy cows are capable of learning a virtual fencing system in rotational grazing management and how their well-being is affected by its use. Twenty dairy cows were divided into 4 groups (2× treatment, 2× control) of 5 individuals. Groups were balanced according to age. Each group grazed four separate rectangular plots during 21, 14, 14 and 7 days. All plots were conventionally fenced and of equal size. Within the plots of the treatment groups, a straight virtual boundary was set on one side. For 59 days, GPS collars recorded the cow’s location per min and any interaction with the virtual boundary. Milk samples were collected individually at the beginning, middle and end of each period to determine milk cortisol concentrations. The total number of stimuli per cow decreased over time, with the number of audio tones (AT) far exceeding the number of electric pulses (EP) in each period. The mean ratio of AT to EP was 12.4 and 15.3 of treatment group one and two, respectively. The total number of electric pulses decreased from 64 (SD±1.02) in the first, to 0 in the last period. An ANOVA revealed that the cortisol concentrations did not significantly differ between control and treatment groups (F(3)=0.583, P=0.626). Provided that animals are given sufficient time to learn, all cows were successfully kept in their assigned area using a virtual fencing system.