I was having issue with the internet for few days on my windows 10 lenovo laptop and I followed so many suggestions and even reset the laptop but nothing worked until I found this.
The trick was to open CMD window as an administrator and run these commands and restart your computer.