The every day things from Thalamus' life.

Thalamus' Blog

18 August, 2013

Fedora – libvirtd – dnsmasq and NetworkManager

Filed under: ComputerStuff_en — Thalamus @ 01:52

Last week I had a peek under the hood of Fedora’s dnsmasq implementation. As I’ve mentioned before. I’ve gone from using VirtualBox to kvm/qemu to run my windows7 and outlook client on at work. I noticed that this ment that dnsmasq was enabled on my computer and that libvirt installed ad virbr0 device where dnsmasq where listening for dhcp requests from my virtualized machine. No worries, everything was working as it should.

dnsmasq is a small daemon that can do such things, and more. I noticed that my co-worker had an installtion where his PC where asking all his configured name servers, all at once, for every “new” host he needed to reach, and these request got cached quite efficently. So, I descided I wanted to reproduce his setup on my Fedora installation.

The first thing I noticed .. as stated before. libvirt had already started an instance of dnsmasq and if I tried to start the default one it would fail, complaning that port 53 where occupied. Ok, sounds sane enough. But, would this mean I had to choose either running a virtual machine or get local cache to be more efficient ? No, I could just use the already started dnsmasq instance listening on 192.168.22.1 and the cache would work. But, what about the multiple server requests all at once ?

This is where the fun began. I hunted down every possible configfile locations I could come up with for a config file that controlled the setup of libvirtd, wich I though where the daemon that controlled the setting for the dnsmasq instance running. But, no luck. I then found that this was really started by NetworkManager, but, still I could not find any config that I could tweak. I could see that the process was running on my machine with the parameter ‘–stict-order’, wich was exactly the opposite of what I was looking for. I needed this feature in order to get the same functionality !

So, once again, after hunting down all locations I could think of for these settings I came up blank. Then I came to think of static settings inside NetworkManager itself. Bingo. Did a strings on the NetworkManager binary and it became clear to me that this daemon forced the settings to run with ‘–strict-order’. I then started pondering, how can I resolve the fact that if I edit /etc/dnsmasq.conf and trying to start it – it would fail since I had the NetworkManager started deamon listening on port 53 already and that I really could not disable it because of my virtual host.

To keep a long story short. I did find out that these settings could be used, forcing another instanced of dnsmasq to listen to another interface, not trying to listen on already occupied ports.

$ egrep -v "^#|^$" dnsmasq.conf
all-servers
server=/nb.local/xxx.xxx.xxx.xxx ( anon ) 
address=/double-click.net/127.0.0.1
interface=eth0
except-interface=virbr0
bind-interfaces
domain=xx.xxxx (anon, windows domain name)
srv-host=_ldap._tcp,xxx-xx.xx.xx,389 ( anon ldap )
conf-dir=/etc/dnsmasq.d

setting bind-interfaces and excluding virbr0, I was able to keep the dnsmasq running on my aliased 192.168.200.1, but, at the same time staring my own config on the other network cards’ ip addresses. Now, I could as you see, run with two separate dnsmasq installations, and they would ask all the servers each and every time in stead of having to wait 2 seconds if the first and prefered dns server where down.

Please bare in mind … xxx is here replaced by ip addresse and other info I don’t want to share with the whole world šŸ™‚

• • •
 

1 August, 2013

Customize those vim colorschemes – the eazy way

Filed under: ComputerStuff_en — Thalamus @ 00:34

Came over an absolute god sent tool for a nerd like me. I’ve used Vim for a long time now. But recently I’ve spent some extra time in order to customize and reading up on this awsome editor. In the process I was hunting high and low for a colorscheme that suited my dark (all black) terminal. I found some that where OK, but those I liked the most had some flaws. So, I googled and found this very nice site called Vivify.

I first fooled around with the tool and came up with my very own colorscheme in minutes. It wasn’t perfect, but, then I descied to upload some of my previous favorites. Molokai, Desert256 and Xoria256. Small tweaks and now I cannot descide wich I love the most šŸ˜‰

• • •