You are on page 1of 10

Mostrar adaptadores e red

ip link

sudo netplan generate

network:
version: 2
renderer: networkd
ethernets:
ens160:
dhcp4: true
Follow with:

sudo netplan apply

GUia para DNS

Conocer nombre del host

Hostnamectl

Configurar nombre del host

Hostnamectl set-hostname “server.example.com”

Configurar interfaz con una ip estatica

network:
version: 2
renderer: networkd
ethernets:
enp3s0:
addresses:
- 10.10.10.2/24
gateway4: 10.10.10.1
nameservers:
search: [mydomain, otherdomain]
addresses: [10.10.10.1, 1.1.1.1]

Ocurre que para virtualbox necesitas tener NAT para internet, y HOST-ONLY para que este en la
red
Asi quedaría el netplan

Aquí puedes ver toda la configuración

3
check out the post from @Ahsan.Amin in https://askubuntu.com/questions/984445/netplan-
configuration-on-ubuntu-17-04-virtual-machine?rq=1 since he provided a working netplan and
therefore the solution to my problem. :)
To give you an overview these are the steps that allowed me to set a NAT and host only
connection in Virtualbox. I hope you can adapt them to VMWare.

If you simply want to be able to access the VM (guest OS) from your host (e.g. Windows 10
OS) use host-only adapter and NAT to access the internet from your guest OS. Therefore set
the first network adapter to NAT and the second one to host-only network.
Check with ifconfig on your VM for your ethernet name mine is enp0s3 for NAT and enp0s8
for host-only. Simply my network adapter order.

In order to use the network manager, create a netplan.yml (sudo nano PLAN-NAME.yaml) in
etc/netplan/ and set the file to something like this:

network:
ethernets:
enp0s3:
addresses: []
dhcp4: true
enp0s8:
addresses: [192.168.78.2/24]
dhcp4: no
dhcp6: no
nameservers:
addresses: [8.8.8.8,8.8.4.4]
version: 2
renderer: networkd

Addresses containing the static IP of the current VM. Check the host adapter for its IP and
modify the addresses parameter to your needs.

It is really really important not to set the gateway4 parameter. It prevented me from accessing
the internet.

After you created the plan.yaml, run:

sudo netplan apply


Test everything by pinging google

ping -c 4 8.8.8.8
and using Putty / MobaXterm to connect to your VM (use IP from addresses).

PS: It might be that you also need to create 99-disable-network-config.cfg in


/etc/cloud/cloud.cfg.d/ containing:
Linux
/etc/resolv.conf
equivalent in
Windows 8 to
add Domain
Suffixes Posted by Sufi in Tutorials
To add search domain names to resolve in Linux, I can
simple add them to /etc/resolv.conf file. But what about in
Windows 8? Follow these simple steps to add search
domain names in Windows 8.

1. Find your network adapter in Network Connections. In my


case, I’m using Wi-Fi adapter.
2. Right click on it and go to Properties.
3. Select TCP/IPv4 and click on Properties.
4. Under General tab, click on Advanced. This will open
Advanced TCP/IP Settings window
5. Check on Append these DNS suffixes(in order) and click
on Add…
6. Add one or multiple domain suffix. And click OK in all
previous windows you just opened in a chain (oh the
beauty of Windows legacy systems).
This should take effect right away. If it doesn’t, you have the
option to reboot, or just switch to Linux 😉
apt-get bind9 bind9utils

How To Make Changes In


resolv.conf Permanent in
Ubuntu [Quick Tip]
Last updated November 9, 2017 By Abhishek Prakash 19 Comments
When you change the DNS configuration using /etc/resolv.conf file, you must
have noticed that the changes are not permanent. A reboot and your changes
might revert to the original settings. I had this issue when I changed the DNS
setting to watch Netflix outside USA. Editing resolv.conf solved my problem but
for the moment only. My changes were not permanent and when I looked at
resol.conf file again, I found why it is so. The file clearly mentioned it and I did
not pay attention to it:
# Dynamic resolv.conf(5) file for glibc resolver(3)
generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL
BE OVERWRITTEN
So, as said, my changes were overwritten. Editing resolv.conf is good for instant
testing but the question arises how to make changes in resolv.conf permanent
in Ubuntu or any other Linux system.

In this quick tip, I’ll discuss the solution that you could use to make the changes
in resolv.conf permanent.

Make permanent changes


in resolv.conf:
To make the DNS related changes in resol.conf permanent, you need to change
the DHCP configuration file named dhclient.conf. You can find the file in this
location: /etc/dhcp/dhclient.conf

You’ll see lines like these:

#supersede domain-name "fugue.com home.vix.com";


#prepend domain-name-servers 127.0.0.1;
Remove the preceding “#” and use the domain-name and domain-name-servers
which you want. Save it. Now the DNS related changes will be permanent.
Alternate workaround to
make permanent changes
in resolv.conf:
This workaround needs a program resolvconf to be installed in your system.
Normally this program is installed in many Linux systems by default but to make
sure it is, use the following command in terminal (Ctrl+Alt+T ) in Ubuntu:

sudo apt-get install resolvconf


Once you have made sure that the resolvconf is installed, edit the configuration
file using the following command:

sudo gedit /etc/resolvconf/resolv.conf.d/base


Save it. Now the settings in resolv.conf will be permanent.

I hope this quick tutorial helped you in changing DNS settings and making those
changes permanent. Any questions, suggestions, a word of thanks are welcomed.
Ciao :)

You might also like