If you want to stop having the problem, you need to see why you are losing your IP address. It could be happening when your laptop goes to sleep.
In most cases, the DNS server address is supplied by your Internet service provider. My suspicion, in this case, is that something is changing that address while the laptop is running. Finding the culprit could be a problem.
I’d start my investigation by booting the laptop and not using it for a while. If the DNS address is unchanged, then some application you use is the culprit. If the DNS address changes, look at the network configuration to ensure that an erroneous fixed DNS isn’t configured. Checking the DNS address before and after running an application should identify the culprit.
For More: