AWS DHCP Options and Resolv.conf

AWS DHCP options are set on a per-VPC (Virtual Private Cloud) basis. By default, things like the search scope and DNS servers used by a given AWS Instance are set by DHCP which also provides the private IP address (but not any Elastic IP Addresses). Indeed, the Amazon Virtual Private Cloud is a fundamental core service that makes AWS very useful when managing complex and distinct instances and networks. VPCs include addressing, subnets, security, routing, and offer things like VPNs-as-a-service.

Setting AWS DHCP Options

Go to the VPC console in AWS. Note that DHCP Options cannot be edited, they can only be created, assigned, and deleted. Create a new one without the search scope and with preferred DNS servers. Then Assign to given instances. After assigning them, any DHCP Options that are not assigned to any VPC can be deleted.

Amazon Lightsail and VPCs

There seems to be no evidence that Amazon Lightsail offers any kind of VPC ifrastructure that can be managed (including DHCP Options) and likely each Lightsail instance is its own VPC with default DHCP settings (that cannot be set as above). In which case: Edit the file /etc/sysconfig/network-scripts/ifcfg-eth0 or otherwise appropriate configuration files for a network interface.

nano /etc/sysconfig/network-scripts/ifcfg-eth0

Change contents as such:

PEERDNS=no
DNS1=8.8.8.8
DNS2=1.2.3.4

Change DNS entries to the desired.

Additional Resources and Implications, including a variety of DNS solutions

Comments are closed.