0

The documentation for OCI terraform says that I can add a search domain to resolv.conf but I cannot get this working.

https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_dhcp_options

resource "oci_core_dhcp_options" "dhcp_options" {
  compartment_id = oci_identity_compartment.tf-compartment.id
  options {
    type = "DomainNameServer"
    server_type = "VcnLocalPlusInternet"
  }
  options {
    type = "SearchDomain"
    search_domain_names = [ "mydomain.co.uk" ]
  }
  vcn_id = module.vcn.vcn_id
}

My domain is not appearing in the instances' resolv.conf:

$ cat /etc/resolv.conf
; Any changes made to this file will be overwritten whenever the
; DHCP lease is renewed. To persist changes you must update the
; /etc/oci-hostname.conf file. For more information see
:[https://docs.cloud.oracle.com/iaas/Content/Network/Tasks/managingDHCP.htm#notes]
;
# Generated by NetworkManager
search mydomain.oraclevcn.com public.mydomain.oraclevcn.com
nameserver 169.254.169.254

How can I get this working?

paradroid
  • 219
  • 3
  • 12
  • Shouldn't you update `/etc/oci-hostname.conf` as per the text from `resolv.conf`? – Marko E Dec 17 '22 at 11:04
  • "documentation for OCI terraform says that I can add a search domain to resolv.conf" I do not see this in the resource documentation. – Matthew Schuchard Dec 17 '22 at 11:25
  • @MattSchuchard Isn't that implied here? https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_dhcp_options#search_domain_names – paradroid Dec 17 '22 at 13:31

0 Answers0