Under Windows one has the option to renew or release the DNS lease with
ipconfig /release
ipconfig /renew
Something similar can be done under macOS as well.
For this you will first need to determine what network interface (adapter or device) you would like to use for this.
The easiest way to find that is using networksetup in terminal, like so:
networksetup -listallhardwareports
Which shows a list of network devices, like so (removed a few to keep the list readable):
$ networksetup -listallhardwareports
...
Hardware Port: Ethernet Adapter (en1)
Device: en1
Ethernet Address: 46:2a:52:ad:62:c7
Hardware Port: Ethernet Adapter (en2)
Device: en2
Ethernet Address: 46:3f:52:ad:62:c8
...
Hardware Port: Wi-Fi
Device: en0
Ethernet Address: f4:a4:88:5d:29:2e
...
You can use "ifconfig" for this, which is less convenient in my opinion, as it potentially will list a ton of network interfaces.
Now that you know what network device to use, we can release/renew the DHCP provided IP address like so (used "en0" as an example, sudo is required):
sudo ipconfig set en0 DHCP
Verify the details if you like:
ipconfig getpacket en0
This should produce a litst showing IP4 and IP6 addresses, subnet mask, DNS server, router, etc.