Saturday, October 31, 2015

Fast DNS caching in Debian Jessie with dnsmasq-nocachelimit

Dnsmasq is a popular software to setup a caching nameserver.

The current packages on Debian have a hardcoded limit of 10K names. The software is meant for routers with low memory but servers nowdays have GBs of memory.

I created a personal fork for dnsmasq that removes the cache limit of 10000 names. Meant for modern servers with lots of RAM.

A cache size of 1M names uses about 100MB or RAM.


You can install my binary packages for Debian Jessie from

https://drive.google.com/folderview?id=0B38VG7HG0bZ2Z2d6YVl0MUNvVEk&usp=sharing

After installing, hold the package with

sudo apt-mark hold dnsmasq dnsmasq-base


To setup dnsmasq follow the Debian wiki

https://wiki.debian.org/HowTo/dnsmasq


Later increase the cache-size value to 1000000 in the file /etc/dnsmasq.conf

# Set the cachesize here.
cache-size=1000000



Automated script to transform Ubuntu Trusty into MacBuntu


Run the script here

https://drive.google.com/file/d/0B_TW7XwVogRYZkVldUJxMEFGejQ/view?usp=sharing

The only extra step is to go to 'Startup Applications' and add an item with the command 'docky' (for some reason the config script does not auto run docky).


This is the end result

https://lh5.googleusercontent.com/-RwMQYtS_p_M/VGdMSzOe8EI/AAAAAAAAKi0/dZeBHnFzzU0/s1600/mac-3.jpg

Wednesday, October 21, 2015

Joining Debian 8 Jessie to Active Directory, and sharing files with Samba + realmd

There are three different ways to join a Samba domain in Linux.
  1. Using pbis-open and samba interop 
    1. Pbis open latest (8.3) works on Jessie (download here) to make your Linux box into a Kerberos client to your AD domain
    2. Sadly Pbis Samba interop does not work with latest Samba 4.1 in Debian 8
  2. Using the classical way of Samba + Winbind pam (although this does not include Kerberos)
    1. https://wiki.samba.org/index.php/Setup_a_Samba_AD_Member_Server
  3. Using realmd as below (this is the most modern way I suppose)
    1. https://fedorahosted.org/sssd/wiki/Configuring_sssd_with_ad_server
    2. http://www.hexblot.com/blog/centos-7-active-directory-and-samba

Migrate Samba 4 Active Directory server to new hardware


I migrated my old Proxmox 3.0 KVM based Samba 4 server into a new Proxmox 4.0 LXC container. Luckily migrating Samba 4 is pretty straighforward.

  1. Backup the following directories
    1. sudo tar cvzf back.tgz /etc/samba /var/lib/samba
  2. Turn off the old VM (or computer)
  3. Create a new VM with the same IP and hostname in the new hardware host
  4. Move the backup.tgz to the new VM
  5. Extract on the root
    1. cd /
    2. sudo tar xvzf /home/user/backup.tgz
  6. Now install samba on top of it
    1. sudo apt-get install samba
  7. When prompted to keep your old smb.conf file choose 'keep'
  8. Restart 

Thursday, October 15, 2015

Join Debian Samba 4 Server as secondary (backup) PDC



In Debian 8.2 Jessie, install samba packages and Kerberos client packages

apt-get install samba krb5-user


Follow this guide

https://wiki.samba.org/index.php/Join_an_additional_Samba_DC_to_an_existing_Active_Directory


Lastly, setup dns forwarding for the internal Samba DNS

Add the following line in [global] section of /etc/samba/smb.conf

        dns forwarder = <your dns server ip eg. your router  192.168.100.1>