LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-31-2018, 09:19 AM   #1
ddenial
Member
 
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 221

Rep: Reputation: 41
Ubuntu 18.04 resolv.conf not reflecting nameserver.


Hello

Following is my /etc/netplan/01-netcfg.yaml file:
Code:
$ cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    ens3:
      dhcp4: no
      addresses: [192.168.100.100/24]
      gateway4: 192.168.100.1
      nameservers: 
        search: [out.lan, kvm.lan, nix.lan]
        addresses: [192.168.1.7]
I've specified nameserver and search domains, but nameserver is not reflected in /etc/resolv.conf

Code:
$ ip addr show ens3
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 52:54:00:6a:33:da brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.100/24 brd 192.168.100.255 scope global ens3
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fe6a:33da/64 scope link 
       valid_lft forever preferred_lft forever

$ cat /etc/resolv.conf 
nameserver 127.0.0.53
search out.lan kvm.lan nix.lan

$ dig redhat.com
; <<>> DiG 9.11.3-1ubuntu1.3-Ubuntu <<>> redhat.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32368
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;redhat.com.                    IN      A

;; ANSWER SECTION:
redhat.com.             584     IN      A       209.132.183.105

;; Query time: 6 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Mon Dec 31 19:46:06 IST 2018
;; MSG SIZE  rcvd: 55
If I manually give IP address of nameserver, it works though
Code:
$ dig redhat.com @192.168.1.7
; <<>> DiG 9.11.3-1ubuntu1.3-Ubuntu <<>> redhat.com @192.168.1.7
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50819
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 8502a18659ca6ea341fb367e5c2a251f8b2516a2621f0c02 (good)
;; QUESTION SECTION:
;redhat.com.                    IN      A

;; ANSWER SECTION:
redhat.com.             463     IN      A       209.132.183.105

;; AUTHORITY SECTION:
.                       14545   IN      NS      e.root-servers.net.
.                       14545   IN      NS      i.root-servers.net.
.                       14545   IN      NS      f.root-servers.net.
.                       14545   IN      NS      b.root-servers.net.
.                       14545   IN      NS      l.root-servers.net.
.                       14545   IN      NS      d.root-servers.net.
.                       14545   IN      NS      j.root-servers.net.
.                       14545   IN      NS      g.root-servers.net.
.                       14545   IN      NS      k.root-servers.net.
.                       14545   IN      NS      m.root-servers.net.
.                       14545   IN      NS      c.root-servers.net.
.                       14545   IN      NS      a.root-servers.net.
.                       14545   IN      NS      h.root-servers.net.

;; Query time: 0 msec
;; SERVER: 192.168.1.7#53(192.168.1.7)
;; WHEN: Mon Dec 31 19:48:07 IST 2018
;; MSG SIZE  rcvd: 294
How do I reflect nameserver change in resolv.conf?

Thanks

Last edited by ddenial; 12-31-2018 at 09:23 AM.
 
Old 12-31-2018, 10:32 AM   #2
Brains
Member
 
Registered: Apr 2009
Distribution: Debian testing
Posts: 987

Rep: Reputation: 260Reputation: 260Reputation: 260
/etc/resolv.conf is symlinked to /lib/systemd/resolv.conf.
In that file there are instructions.
You may also want to read the last three posts of this thread.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] NetworkManager 1.2 does not add nameserver to resolv.conf spongetron Slackware 14 04-30-2016 11:31 AM
Secondary nameserver resolv.conf not queried hansaplazt Linux - Networking 6 12-08-2010 05:41 AM
resolv.conf deletes nameserver entries Mirkridian Linux - Wireless Networking 1 02-19-2007 02:59 AM
router being added to resolv.conf as nameserver thatwouldbeme Linux - Networking 3 11-15-2006 01:44 PM
pppd: nameserver -> /etc/resolv.conf ?? tredegar Linux - Networking 6 03-21-2004 08:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration