DHCP gives you an address and also a list of DNS servers. Sometimes you want one but not the other.
# /etc/netplan/63-dhcp.yaml
network: {version: 2, ethernets: {enp3s0: {dhcp4: true, dhcp4-overrides: {use-dns: false}, nameservers: {addresses: [192.168.1.2]}}}}
With use-dns: false, the interface keeps its lease but ignores the DNS servers from it, so the nameservers you list are the ones in use. Check the effect with resolvectl status enp3s0. The same block has use-routes, route-metric and use-ntp, which control the routes, their metric and the NTP servers from DHCP. Run netplan try to test it.
Further reading: Netplan YAML configuration reference