Changing the DNS nameservers in FreeBSD

Adding the nameservers to the /etc/resolv.conf file will only temporarily change the DNS nameservers. After the system is restarted, FreeBSD will default to the DNS servers obtained from the DHCP server.

To permanently alter the DNS nameservers to the ones you want to use, they need to be added to the /etc/dhclient.conf file.

$ sudo nano /etc/dhclient.conf

Add the following to the dhclient.conf file

interface "em0" {
    supersede domain-name-servers 192.168.0.100, 192.168.0.101;
}

Replace the interface “em0” with your default interface name, and obviously the IP address of the DNS nameservers with your own.

For more information read the man pages for dhclient and dhclient.conf.

Note:

If you disable the DHCP server in /etc/rc.conf, for example, by setting a static IP address, the supersede directive will not work. You must then edit the resolv.conf file manually and add the nameservers.

 

10 positive Thoughts from Bob Marley

  1. The greatness of man is not how much wealth he acquires, but in his ability to affect those around him positively.
  2. Some people feel the rain, others just get wet.
  3. Don’t gain the world and loose your soul, wisdom is better than silver or gold.
  4. Love the life you live. Live the live you love.
  5. Beginnings are usually scary, and endings are usually sad, but it’s everything in between that makes it all worth living.
  6. Live for yourself and you will live in vain, live for others, and you will live again.
  7. Don’t worry about a thing ’cause every little thing gonna be alright.
  8. If she’s amazing, she won’t be easy. If she’s easy she won’t be amazing. If she’s worth it you won’t give up. If you give up, you’re not worthy.
  9. You never know how strong you are until strong is the only choice yo have.
  10. The truth is everyone is going to hurt you. You just have to find the ones worth suffering for.

Services running on Linux

service is an application that runs in the background to perform some tasks or waiting for requests from other applications to perform tasks.

Some services are required by the operating system, others are initiated by the user. OS specific services are networking, cron, dbus, ssh, while some of the user specific services are web servers such as Apache or Nginx, or database server such as mysql.

SysVinit vs Systemd

SysVinit is the old and test proven init system, while the Systemd is the newer init system used in many Linux distros.

Location of SysVinit scripts:

Debian: /etc/init.d

Red Hat: /etc/rc.d

Location of Systemd scripts:

{lib/etc}/systemd/

SysVinit uses:

service <service-name> command <options>

Systemd uses:

systemctl [options …] command [service-name …]

Examples:

List all services in /etc/init.d

$ ls -al /etc/init.d

List all services (SysVinit)

$ sudo service --status-all

To start a service (SysVinit)

$ sudo service networking start
$ sudo service cron --full-restart

To stop a service (SysVinit)

$ sudo service networking stop

To show the status of a service (SysVinit)

$ sudo service cron status

List all services, including inactive ones (systemd)

$ systemctl -a --type=service list-units

Start a service (systemd)

$ systemctl start httpd.service

Stop a service (systemd)

$ systemctl stop networking.service

To show the status of a service (systemd)

$ systemctl status cron.service

See also Systemd-vs-SysVinit-cheatsheet

 

Enable root login via SSH on Linux/Unix systems

Most Linux/Unix systems have root login disabled by default.

It is a huge security risk to allow root login via SSH, so if for some particular reason you need root login via SSH, enable it temporarily to perform need tasks, then disable it right away to secure your system.

FreeNAS:

  • go to Services -> SSH config
  • enable Login as Root with password
  • OK to save

Linux/FreeBSD:

  • edit the /etc/ssh/sshd_config file
    • $ sudo nano /etc/ssh/sshd_config
  • set PermitRootLogin yes
  • restart sshd
    • $ systemctl restart sshd

For more information on sshd_config settings read the man page.

The Biomass Distribution on Earth

Article published in the Proceedings of the National Academy of Sciences of the United States of America, reveals that the global biomass pyramid contains more consumers than than producers. It also highlights the impact of humanity on the global biomass of other taxa, such as mammals, fish and plants.

http://www.pnas.org/content/early/2018/05/15/1711842115

The Guardian – Article

https://www.theguardian.com/environment/2018/may/21/human-race-just-001-of-all-life-but-has-destroyed-over-80-of-wild-mammals-study