- 最新
- 最多得票
- 最多評論
It sounds like the EC2 instance is unable to properly resolve DNS names, which is preventing it from accessing the internet. One possible solution would be to modify the nameserver in the /etc/resolv.conf file to use a valid external DNS server, such as 8.8.8.8 or 8.8.4.4 (Google's public DNS servers). However, you mention that this change is not persistent and that the file is reverting back to its original state.
A possible cause could be that the AMI has a script that runs on startup that restores the original /etc/resolv.conf file. You may want to check for any such scripts and modify or disable them.
Another possible cause could be that the DHCP client on your instance is not properly updating the /etc/resolv.conf file. You may want to check the DHCP client configuration and ensure that it is set to update the DNS server information.
You can also try to use AWS Systems Manager to run commands on your instances. This can be useful to update the DNS server or check the DHCP configuration.
相關內容
- 已提問 6 個月前
- AWS 官方已更新 2 年前