Change DNS IP Linux Mint 18

Problem

The automatic ISP DNS IP was faulty. Need to switch to another DNS server. Another problem was that Editing the resolv.conf would be overwritten.

Solution

  • Click on the Wi-fi button And select Network Connections:
Wifi Icon
Wifi Icon
Network Connections
Network Connections
  • Click on the Wifi Network you want to add the DNS addresses. From the resulting Dialogue box, click on the IPv4 Settings and add the Additional DNS servers e.g the OpenDNS IPs 208.67.220.220; 208.67.222.222 and then save:
Add DNS IPs
Add DNS IPs
  • Then Click on the Wi-Fi Icon and click on Network Settings. Then select the Preferences Icon (As shown in the screenshot below). Then Click on IPv4 and In the DNS Section Click on the Automatic ON button so that its OFF and then click Apply:
Network Settings
Network Settings

Network Preferences - IPv4 selection

Network Preferences – IPv4 selection

Network Preferences - Save Changes

Network Preferences – Save Changes

  • Finally turn of the Wifi and Turn it ON again and your changes should persist. You should be using the New DNS addresses IPs ONLY.

Docker – HowTos

Tips

  • To check which containers are running:
docker ps
  • To check all the docker containers:
docker ps -a
  • To get into a docker container’s terminal:
docker exec -it docker-container-name sh
  • To copy a file to a docker container:
docker cp /home/user/path to file you want to copy.txt docker-container-name:/home/destination_folder/
  • To have a docker container start automatically. If you had already done a docker run, then:
docker rm docker-container-name
docker run --restart=always docker-container-name
  • There are 3 restart policies one can use:
    • –restart=always : will try to restart the docker container regardless of the reason for it stopping
    • –on-failure[:10] : will try to restart the docker container only if it exits with a non-zero status (failure). It will attempt to do this 10 times in the example above
    • unless-stopped : always restart the container regardless of the exit status. The container wont be started on docker daemon start up if it was on a stop state.

Remove all docker containers:

docker rm $(docker ps -a -q)

Remove all docker images:

docker rmi $(docker images -q)

Resources

Restart policies (–restart)

The exit status of a command

How does one remove an image in Docker?

Command to remove all unused images

How to Remove Docker Images and Containers

Filter events by criteria

How to remove a docker container on Linux

How to stop and remove the docker