How to set DNS server address temporarily?

Write it into /etc/resolv.conf:

echo "nameserver 1.2.3.4" | sudo tee /etc/resolv.conf

Upon successful DHCP connection, it should be overwritten back to the "correct" DNS server.