Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Search a local domain in 18.04?

  1. #1
    Join Date
    Jul 2006
    Beans
    4,860

    Search a local domain in 18.04?

    Hi friends. In previous versions of Ubuntu Server, in an effort to get local DNS name resolution working (where I can ping the server by name from another system on my network), I'd run these commands on my server:

    1. echo "search local" | sudo tee /etc/resolvconf/resolv.conf.d/tail
    2. sudo resolvconf -u

    This doesn't seem to be working in 18.04, which I assume is partly due to netplan taking over network duties. The catch is, my netplan config file is as follows:

    Code:
    network:
      version: 2
      renderer: networkd
      ethernets:
        enp3s0:
          addresses: [10.13.0.200/24]
          dhcp4: no
          dhcp6: no
          gateway4: 10.13.0.1
          nameservers:
            addresses: [10.13.0.2]
            search: [lan]
    I have right there that my search domain is lan, yet I am unable to ping this server by name. This box hosts about 5 additional Ubuntu Server instances on top of KVM, though the virtual servers I have set to DHCP and I let my DHCP/DNS server (which is a VM running PiHole @ 10.13.0.2) dish out the IP addresses. As such, it seems as if IPs that come from the PiHole VM over DHCP work absolutely fine, as I can ping all virtual servers by name without issue, though the main host server with a static IP I cannot ping by name. It's worth noting that the PiHole is set to "lan" for the local domain as well.

    According to my notes, the resolvconf text I pasted above was the ticket in years prior. Not entirely sure what the correct protocol is now. Anybody know? Would appreciate any and all insight. Thank you!

  2. #2
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    14,241
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Search a local domain in 18.04?

    Is the domain .local or .lan? There is inconsistency in the two comparisons you wrote.

    The netplan file looks correct to search for domain named .lan.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

  3. #3
    Join Date
    Jul 2006
    Beans
    4,860

    Re: Search a local domain in 18.04?

    Sorry, I wrote that late. The domain is lan. I admittedly didn't try the command from my notes with lan appended because most of the path didn't exist. With netplan being quite different I thought that was the first sign that the commands in my notes were no longer useful on new versions, then once I realized I saw I had search lan in the netplan config I felt I hit a wall as documentation online suggested that that's what I needed to make it work yet I was still unable to make it fly.

  4. #4
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    14,241
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Search a local domain in 18.04?

    Hmmm, in that case it does look like you have netplan configured correctly.

    To rule out DNS issues, did you try dig or nslookup by adding .lan yourself manually? Does it return the correct output? I would confirm that first before continuing the investigation why it doesn't append .lan automatically.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

  5. #5
    Join Date
    Jul 2006
    Beans
    4,860

    Re: Search a local domain in 18.04?

    Quote Originally Posted by darkod View Post
    Hmmm, in that case it does look like you have netplan configured correctly.

    To rule out DNS issues, did you try dig or nslookup by adding .lan yourself manually? Does it return the correct output? I would confirm that first before continuing the investigation why it doesn't append .lan automatically.
    Hm, so if I ping vault.lan, it doesn't work. If I ping vault.local, it responds to ping. Clearly it's somehow triggering with local appended. I dug around to see where it may be pulling from, but so far I'm not finding it.

    Code:
    administrator@vault:~$ cat /etc/resolv.conf
    # This file is managed by man:systemd-resolved(8). Do not edit.
    #
    # This is a dynamic resolv.conf file for connecting local clients to the
    # internal DNS stub resolver of systemd-resolved. This file lists all
    # configured search domains.
    #
    # Run "systemd-resolve --status" to see details about the uplink DNS servers
    # currently in use.
    #
    # Third party programs must not access this file directly, but only through the
    # symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
    # replace this symlink by a static file or a different symlink.
    #
    # See man:systemd-resolved.service(8) for details about the supported modes of
    # operation for /etc/resolv.conf.
    
    nameserver 127.0.0.53
    search lan
    Code:
    administrator@vault:~$ cat /etc/netplan/01-network-manager-all.yaml 
    #Let NetworkManager manage all devices on this system network:
    #network:
    #  version: 2
    #  renderer: NetworkManager
    network:
      version: 2
      renderer: networkd
      ethernets:
        enp3s0:
          addresses: [10.13.0.200/24]
          dhcp4: no
          dhcp6: no
          gateway4: 10.13.0.1
          nameservers:
            addresses: [10.13.0.2]
            search: [lan]
        enx00249b11e1fa:
          dhcp4: yes
    Code:
    administrator@vault:~$ cat /etc/hosts
    127.0.0.1	localhost
    127.0.1.1	vault
    
    # The following lines are desirable for IPv6 capable hosts
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    Not sure where else it would be pulling from. Any ideas?

  6. #6
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    14,241
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Search a local domain in 18.04?

    What about:
    Code:
    cat /etc/hostname
    What settings do you have on the DNS server? I assume you have some sort of DNS in your LAN because otherwise where would it get the IPs from. Maybe the .local is set on the DNS?

    Try from other machines in the LAN, don't focus only on the one server. Does ping work on other machines with hostname.lan or hostname.local?
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

  7. #7
    Join Date
    Jul 2006
    Beans
    4,860

    Re: Search a local domain in 18.04?

    Quote Originally Posted by darkod View Post
    What about:
    Code:
    cat /etc/hostname
    What settings do you have on the DNS server? I assume you have some sort of DNS in your LAN because otherwise where would it get the IPs from. Maybe the .local is set on the DNS?

    Try from other machines in the LAN, don't focus only on the one server. Does ping work on other machines with hostname.lan or hostname.local?
    All systems on the network except one uses DHCP. The DHCP server has the domain set to "lan". All other systems respond to ping by their hostname without the domain. For example, my web server responds to "ping web" and "ping web.lan" but it does not respond to "ping web.local". All systems on the network behave the same way, where pinging hostname.local fails, but ping hostname works and ping hostname.lan works.

    My main server, named vault, responds to "ping vault.local" only. It fails on "ping vault" and "ping vault.lan". The main 'vault' server is the only static machine on the network.

    Hostname file is as follows:
    Code:
    administrator@vault:~$ cat /etc/hostname
    vault
    With my vault server having "search: [lan]" from the code blurbs pasted above in every area I'd expect it to matter I would have expected vault to respond via ping vault or ping vault.lan, but it only responds to vault.local, which tells me somehow, somewhere, 'local' is appended as the search domain somewhere on this box. I'm just not sure where. The underpinnings of netplan are new to me but if I'm doing something wrong I haven't caught on to it yet as per what documentation I've read to date.

    Thanks for your assistance. Greatly appreciated!

  8. #8
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    14,241
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Search a local domain in 18.04?

    Got one idea... Where is the DHCP server?

    Is it on 10.13.0.1 (is that the router?) or on 10.13.0.2?

    What is the DNS offered to the LAN machines by dhcp, is it .1 or .2?

    PS. I'm trying to figure out if there is a difference between vault using the .2 as dns nameserver, and the other machines. Do they use .2 too, or maybe .1 if that is the router issuing dhcp and issuing itself as dns nameserver.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

  9. #9
    Join Date
    Jul 2006
    Beans
    4,860

    Re: Search a local domain in 18.04?

    .1 is my unifi usg. Basically my router. DHCP and dns disabled there.

    .2 is PiHole, serving DHCP and dns for the network.

    Recently the usg had been employing DHCP with dns being on the PiHole but I moved both to PiHole so it was easier to maintain internal hostname resolution. Previously when the usg was used for dhcp I still used lan as the domain. Perhaps there's something buried in between those two network devices though.... Nothing comes to mind as I've looked into their settings quite a bit but I'll do another scrub of the settings in case.

    Thanks again.

  10. #10
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    14,241
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Search a local domain in 18.04?

    Can this offer some ideas to you? https://askubuntu.com/questions/1027...m-ubuntu-18-04

    Even though the owner of that thread was actually using .local as domain which isn't your case. But still, playing with the file he mentioned might help you.

    And another thing, after changes to the netplan yaml, you are using 'sudo netplan apply' to apply the settings, right?

    I still don't have 18.04 server so it is difficult for me to look around inside it...
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •