We are not sure how your setup and configuration on the router and where this router located in the network.
from router internet is reachable
Can you explain how this was working, i take this as Lan side working for LAP IP address.
May be try adding source interface for the License server to reachable.
example : (i used example Loopback - change the interface based on the environment).
ip domain lookup (make sure you configured name servers)
ip domain lookup source-interface Loopback0
ip http client source-interface Loopback0
Look at the troubleshooting :
https://www.cisco.com/c/en/us/support/docs/switches/catalyst-9500-series-switches/214484-cisco-smart-licensing-troubleshooting.html