Windows Server 2019 warns No Internet Access after AD, DNS and DHCP setup

Use the bellow command to fix this isue

sc config nlasvc depend= DNS

It overwrites all dependencies the service currently has. So if you want to add and not overwrite the service’s dependencies list, a solution would be first to get the dependencies list, running this command:

sc qc nlasvc

That outputs this:

SERVICE_NAME: nlasvc
        TYPE               : 20  WIN32_SHARE_PROCESS
        START_TYPE         : 2   AUTO_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : C:\Windows\System32\svchost.exe -k NetworkService -p
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : Network Location Awareness
        DEPENDENCIES       : NSI
                           : RpcSs
                           : TcpIp
                           : Dhcp
                           : Eventlog
        SERVICE_START_NAME : NT AUTHORITY\NetworkService

Then run this command to add DNS:

sc config nlasvc depend= NSI/RpcSs/TcpIp/Dhcp/Eventlog/DNS