Answers: <p>This is something that can really only be answered by your Cloud administrators.</p>
  <ol>
  <li>The openstacklocal domain is a premade domain that Openstack uses for internal DNS names.</li>
  <li>It does not mean that it will be usable out of the box.</li>
  <li>To test, you can try to ping 192.168.199.2-3-4 from your VM to see if the dhcp agent responds. You can then try to query the dhcp agent with <code>dig</code></li>
  </ol>
  <p>Now, there seem to be deeper DNS support with ml2.</p>
  <ol start="3">
  <li>The ML2 driver will need to include dns <a href="https://docs.openstack.org/mitaka/networking-guide/config-dns-int.html" rel="nofollow noreferrer">Link to doc</a></li>
  <li>You will need to use the DHCP agent IP as DNS servers. Usually, it's the first two/three IP of your subnet.</li>
  <li>It will create DNS names for your subnet/ports.</li>
  </ol>
  
Answers: CC BY-SA 4.0
Answers: 2022-02-23T20:41:21.700Z
Answers: re: test suggested, I found the dhcp server by running `sudo grep "Received dhcp lease" /var/log/cloud-init.log` and I tried to target it as a nameserver, but it didn't respond. I guess the dhcp server in openstack is not also a nameserver.
Answers: Evan Carroll
Answers: CC BY-SA 4.0
Answers: 2022-02-23T20:46:32.823Z
Answers: _"It does not mean that it will be usable out of the box."_ like that should certainly better explained in the docs., and what any of this functionality means if it's not usable out of the box.
Answers: Evan Carroll
Answers: CC BY-SA 4.0
Answers: 2022-02-23T20:23:05.070Z
Answers: 2022-02-23T20:23:05.070Z
Answers: LaurentDumont
Body: <p>This is an extension and a simplification of my prior problem. I have created a</p>
  <ul>
  <li>Network</li>
  <li>Subnet</li>
  <li>A port attached to the above network and subnet</li>
  <li>A compute instance on that port.</li>
  </ul>
  <p>With the following Terraform script,</p>
  <pre><code>provider &quot;openstack&quot; {
    tenant_name = &quot;admin&quot;
    cloud       = &quot;openstack&quot;
  }
  
  resource &quot;openstack_compute_instance_v2&quot; &quot;test-server&quot; {
    name        = &quot;test-server&quot;
    flavor_name = &quot;m1.medium&quot;
    key_pair    = &quot;cp-2021&quot;
    # Ubuntu
    image_name = &quot;ubuntu-20.04&quot;
    user_data  = data.template_file.user_data.rendered
    network { port = openstack_networking_port_v2.port_project.id }
  }
  
  ## Here we're trying to create a project association
  resource &quot;openstack_networking_network_v2&quot; &quot;net_project&quot; {
    name           = &quot;net_project&quot;
    admin_state_up = &quot;true&quot;
  }
  
  resource &quot;openstack_networking_subnet_v2&quot; &quot;subnet_project&quot; {
    name       = &quot;subnet_project&quot;
    network_id = openstack_networking_network_v2.net_project.id
    cidr       = &quot;192.168.199.0/24&quot;
    ip_version = 4
  }
  
  resource &quot;openstack_networking_port_v2&quot; &quot;port_project&quot; {
    name           = &quot;port_project&quot;
    network_id     = openstack_networking_network_v2.net_project.id
    admin_state_up = &quot;true&quot;
    fixed_ip {
      subnet_id = openstack_networking_subnet_v2.subnet_project.id
    }
  }
  </code></pre>
  <p>In Horizon's under <code>project/networks/ports/384f70d3-360b-478f-9c39-23dc804a3b5f/detail</code>, this subnet does not show a DNS server,</p>
  <pre><code>Name: port_project
  ID: 384f70d3-360b-478f-9c39-23dc804a3b5f
  Network Name: net_project
  Network ID: 33091875-5a4b-40e0-9e79-efac82cbd324
  Project ID: ce9d50b729aa4a7a95c21e534105725c
  MAC Address: fa:16:3e:e0:74:d7
  Status: Active
  Admin State: UP
  Port Security Enabled: True
  DNS Name: None  &lt;- **NAMESERVER FIELD SHOWS NONE**
  </code></pre>
  <p>But it still shows an Assignment (same page)</p>
  <pre><code>**DNS Assignment**
  Hostname host-192-168-199-158
  IP Address 192.168.199.158
  FQDN host-192-168-199-158.openstacklocal.
  </code></pre>
  <p>What is that DNS Assignment with? What can resolve this FQDN?</p>
  
Tags: <terraform><openstack>
Title: How does a new network and subnet have FQDNs without DNS Nameservers?
UserDisplayName: Evan Carroll
ThreadText: # How does a new network and subnet have FQDNs without DNS Nameservers?
  
  (Asked by: username_0 on 2022-02-23)
  
  This is an extension and a simplification of my prior problem. I have created a
  
  * Network
  * Subnet
  * A port attached to the above network and subnet
  * A compute instance on that port.
  
  With the following Terraform script,
  
  ```
  provider "openstack" {
    tenant_name = "admin"
    cloud       = "openstack"
  }
  
  resource "openstack_compute_instance_v2" "test-server" {
    name        = "test-server"
    flavor_name = "m1.medium"
    key_pair    = "cp-2021"
    # Ubuntu
    image_name = "ubuntu-20.04"
    user_data  = data.template_file.user_data.rendered
    network { port = openstack_networking_port_v2.port_project.id }
  }
  
  ## Here we're trying to create a project association
  resource "openstack_networking_network_v2" "net_project" {
    name           = "net_project"
    admin_state_up = "true"
  }
  
  resource "openstack_networking_subnet_v2" "subnet_project" {
    name       = "subnet_project"
    network_id = openstack_networking_network_v2.net_project.id
    cidr       = "192.168.199.0/24"
    ip_version = 4
  }
  
  resource "openstack_networking_port_v2" "port_project" {
    name           = "port_project"
    network_id     = openstack_networking_network_v2.net_project.id
    admin_state_up = "true"
    fixed_ip {
      subnet_id = openstack_networking_subnet_v2.subnet_project.id
    }
  }
  
  ```
  
  In Horizon's under `project/networks/ports/384f70d3-360b-478f-9c39-23dc804a3b5f/detail`, this subnet does not show a DNS server,
  
  ```
  Name: port_project
  ID: 384f70d3-360b-478f-9c39-23dc804a3b5f
  Network Name: net_project
  Network ID: 33091875-5a4b-40e0-9e79-efac82cbd324
  Project ID: ce9d50b729aa4a7a95c21e534105725c
  MAC Address: fa:16:3e:e0:74:d7
  Status: Active
  Admin State: UP
  Port Security Enabled: True
  DNS Name: None  <- **NAMESERVER FIELD SHOWS NONE**
  
  ```
  
  But it still shows an Assignment (same page)
  
  ```
  **DNS Assignment**
  Hostname host-192-168-199-158
  IP Address 192.168.199.158
  FQDN host-192-168-199-158.openstacklocal.
  
  ```
  
  What is that DNS Assignment with? What can resolve this FQDN?
  
  **Tags:** terraform, openstack
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-02-23. Score: 2
  
  This is something that can really only be answered by your Cloud administrators.
  
  1. The openstacklocal domain is a premade domain that Openstack uses for internal DNS names.
  2. It does not mean that it will be usable out of the box.
  3. To test, you can try to ping 192.168.199.2-3-4 from your VM to see if the dhcp agent responds. You can then try to query the dhcp agent with `dig`
  
  Now, there seem to be deeper DNS support with ml2.
  
  3. The ML2 driver will need to include dns [Link to doc](https://docs.openstack.org/mitaka/networking-guide/config-dns-int.html)
  4. You will need to use the DHCP agent IP as DNS servers. Usually, it's the first two/three IP of your subnet.
  5. It will create DNS names for your subnet/ports.
  
  > **Comments:**
  > **username_0**: re: test suggested, I found the dhcp server by running `sudo grep "Received dhcp lease" /var/log/cloud-init.log` and I tried to target it as a nameserver, but it didn't respond. I guess the dhcp server in openstack is not also a nameserver.  
  > **username_0**: _"It does not mean that it will be usable out of the box."_ like that should certainly better explained in the docs., and what any of this functionality means if it's not usable out of the box.  
  
  ---
  
  