Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: DNS issue with Netplan

  1. #1
    Join Date
    Nov 2018
    Beans
    14

    DNS issue with Netplan

    I'm having an issue with Netplan(I believe) where after a few hours it will stop reading my nameservers. I can run
    Code:
    netplan apply
    which will fix the issue temporarily, but then when I come back the next day the server appears to not be looking at my nameservers again.

    for example If I run nslookup on the domain that is pointed at the server I get

    Code:
    Non-authoritative answer:
    *** Can't find example.domain.com: No answer
    Any ideas on how to make this stop? This has been an issue because when I call other files in with file_get_contents I get the error.
    Code:
    getaddrinfo failed: No address associated with hostname

    Right now i'm just having to refresh my netplan by applying my config again periodically. To be clear I dont actually have to change the netplan config, I just have to run the command to apply it again to fix the problem.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: DNS issue with Netplan

    Is the IP networking all working still or just the DNS? For example, can you ping the DNS server BEFORE doing any corrective action?

  3. #3
    Join Date
    Nov 2018
    Beans
    14

    Re: DNS issue with Netplan

    The IP networking continues to work. It appears its just a DNS thing. I can still SSH in, I can ping it. It can ping out. Its like it just stops looking at the DNS server for whatever reason.

  4. #4
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: DNS issue with Netplan

    That is helpful.

    Does the /etc/resolv.conf still hold the correct information?

  5. #5
    Join Date
    Nov 2018
    Beans
    14

    Re: DNS issue with Netplan

    When I run systemd-resolve --status it displays the correct IPs for our nameservers in the DNS Servers line. however if I cat the /etc/resolve file it says nameserver 127.0.0.53

    edit: also as of this morning just running netplan apply is not correcting it anymore.
    Last edited by psd-joshe; November 13th, 2018 at 06:23 PM.

  6. #6
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,560
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: DNS issue with Netplan

    The .53 is normal for 18.04. It is called stub or what ever. If you look with netstat it will show that you have port 53 listening on 127.0.0.53. When that receives a dns request, it asks your dns servers in the background. My 18.04 works correctly like that.

    Code:
    darko@filesrv:~$ 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
    Code:
    darko@filesrv:~$ sudo netstat -plunt | grep 53
    [sudo] password for darko: 
    tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      4253/systemd-resolv 
    tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      2066/dnsmasq        
    udp    39936      0 127.0.0.53:53           0.0.0.0:*                           4253/systemd-resolv 
    udp        0      0 192.168.122.1:53        0.0.0.0:*                           2066/dnsmasq
    Code:
    darko@filesrv:~$ dig google.com
    
    ; <<>> DiG 9.11.3-1ubuntu1.2-Ubuntu <<>> google.com
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50457
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 65494
    ;; QUESTION SECTION:
    ;google.com.   IN	A
    
    ;; ANSWER SECTION:
    google.com.  299	IN	A	216.58.201.174
    
    ;; Query time: 78 msec
    ;; SERVER: 127.0.0.53#53(127.0.0.53)
    ;; WHEN: Tue Nov 13 18:40:12 CET 2018
    ;; MSG SIZE  rcvd: 55
    Notice how the dig reply comes from 127.0.0.53?
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

  7. #7
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,560
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: DNS issue with Netplan

    Can you post your netplan file please?
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

  8. #8
    Join Date
    Nov 2018
    Beans
    14

    Re: DNS issue with Netplan

    Here is my netplan file

    Code:
    server:/etc$ cat /etc/netplan/01-network-card.yaml 
    network:
            version: 2
            renderer: networkd
            ethernets:
                    enp2s0f0:
                            dhcp4: no
                            addresses: [158.91.4.26/24]
                            gateway4: 158.91.4.254
                            nameservers:
                                    search: [provo.edu]
                                    addresses: [158.91.5.199,158.91.5.203]

  9. #9
    Join Date
    Nov 2009
    Location
    Catalunya, Spain
    Beans
    14,560
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: DNS issue with Netplan

    Are those tabs inside the text file? I have seen comments that it doesn't work correct with tabs. You should use space bar and correct indent. Like 3 spaces to the right of the previous line (when indent is needed).
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 18.04 LTS 64bit

  10. #10
    Join Date
    Nov 2018
    Beans
    14

    Re: DNS issue with Netplan

    they are space bar spaces as I had netplan fail to apply when I did it with tabs. I had done it completely by hand in the past and have had the same results. where it will work onces I change the file for a day and then go back to ignoring the name servers.

    My netplan config file looks like this now
    Code:
    server:/etc$ cat /etc/netplan/01-network-card.yaml 
    network:
       version: 2
       renderer: networkd
       ethernets:
          enp2s0f0:
             dhcp4: no
             addresses: [158.91.4.26/24]
             gateway4: 158.91.4.254
             nameservers:
                search: [provo.edu]
                addresses: [158.91.5.199,158.91.5.203]
    after doing a neplan generate, and netplan apply it is now working(as expected). I'll check back in if it stops working again tomorrow as it has previously.
    Last edited by psd-joshe; November 13th, 2018 at 08:10 PM.

Page 1 of 3 123 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
  •