Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rb:ubuntu1804netplan [25/08/2019 23:15]
andrew [Basic static address]
rb:ubuntu1804netplan [03/04/2020 11:19] (current)
andrew [Updating resolv.conf]
Line 32: Line 32:
     ens3:     ens3:
       addresses:       addresses:
-        - 192.168.5.28/24 +        - 192.168.5.YYY/24 
-      gateway4: 192.168.5.1+      gateway4: 192.168.5.ZZZ
       nameservers:​       nameservers:​
-          search: [rainsbrook.co.uk, ​int.rainsbrook.co.uk] +          search: [rainsbrook.co.uk, ​sub.rainsbrook.co.uk] 
-          addresses: [192.168.5.24, 1.1.1.1]+          addresses: [192.168.5.XXX, 1.1.1.1]
 </​code>​ </​code>​
  
Line 54: Line 54:
  
  
-.+ 
 +===== Updating resolv.conf ===== 
 + 
 +''/​etc/​resolv/​conf''​ is now a symlink as below:- 
 + 
 +<code bash> 
 +root@argon:​~#​ ls -l /​etc/​resolv.conf 
 +lrwxrwxrwx 1 root root 39 Apr  3 08:41 /​etc/​resolv.conf -> ../​run/​systemd/​resolve/​stub-resolv.conf 
 + 
 +root@argon:​~#​ ls -l /​run/​systemd/​resolve/​* 
 +-rw-r--r-- 1 systemd-resolve systemd-resolve 633 Apr  3 12:04 /​run/​systemd/​resolve/​resolv.conf 
 +-rw-r--r-- 1 systemd-resolve systemd-resolve 760 Apr  3 12:04 /​run/​systemd/​resolve/​stub-resolv.conf 
 +</​code>​ 
 + 
 +Two choices seem to exist, the resolv.conf file is the one updated by netplan, so let's use this:- 
 +<code bash> 
 +root@argon:​~#​ ln -s /​run/​systemd/​resolve/​resolv.conf /​etc/​resolv.conf 
 +ln: failed to create symbolic link '/​etc/​resolv.conf':​ File exists 
 +root@argon:​~#​ mv /​etc/​resolv.conf /​etc/​resolv.conf.orig 
 +root@argon:​~#​ ln -s /​run/​systemd/​resolve/​resolv.conf /​etc/​resolv.conf 
 +root@argon:​~#​ rm /​etc/​resolv.conf.orig 
 +</​code>​ 
 + 
 +You could just use ''​ln -sf''​ to force the link creation, but if something goes wrong, you loose the original file. 
 + 
 +Test with ''​dig''​ or ''​nslookup''​ and resolution should work as expected.
  

rb/ubuntu1804netplan.1566774941.txt.gz · Last modified: 25/08/2019 23:15 by andrew