I run my own local DNS server for DNS caching, and handling the local DHCP domains.

As my main firewall/router doesn’t move around (and thus doesn’t need to change it’s DNS), I prefer to hard code my /etc/resolv.conf file to add my local domains and DNS server. However, Fedora overwrites the /etc/resolv.conf file whenever the network boots.

Found an easy fix to this today. Add the following line to every ifcfg-* file in /etc/sysconfig/network-scripts

PEERDNS=no

The PEERDNS line causes the dhclient script to not find the DNS server for that network link and add it to resolv.conf, so it leaves the file alone.

Here’s my resolv.conf:

search home
; Local machine's nameserver
nameserver 127.0.0.1
; Telstra's nameservers in case mine is down
nameserver 61.9.134.49
nameserver 61.9.194.49
nameserver 61.9.207.1

20 Mar, 2011  |  Written by  |  under Uncategorized

Well, I’ve recently switched from a cable modem (in bridge mode) to an ADSL modem (also in bridge mode).

Placing the modem in bridge mode gives me lots of advantages because my Linux router computer becomes the computer that has the external IP address. That allows me to easily create servers (http, opendns, vpn) on my router and view all network traffic into and out from my internet connection.

It adds some headaches too – mostly having to set firewall rules (I use the excellent FireHol).

The cable modem was great because it gave me a DHCP server that I connected to, the IP it gave me was the world-viewable IP and any traffic I sent out that interface went to the Internet.

The ADSL modem is a little different. I need to set and keep a PPPoE connection alive and ppp0 is where all traffic is sent.

Not a big deal, except with Fedora 14, I couldn’t get the ppp0 network to startup on boot. I installed rp-pppoe (yum install rp-pppoe) and set it up with pppoe-setup. Nice and simple. However on a reboot the network didn’t come up. It started when I issued pppoe-start, but I didn’t want to do it manually. Searching the logs I saw:

NetworkManager[2171]: ifcfg-rh: error: Unknown connection type 'xDSL'

Looks like Network Manager doesn’t like the older-style ifcfg-ppp0 file created by pppoe-setup, so ignores the file.

The simplest method to fix this seems to be disabling Fedora’s Network Manager. That will also give me an advantage in stopping the box from reloading it’s network settings whenever I change the ifcfg- files (which usually ends up making the box un-accessible remotely to me as I have a habit of saving while part way through editing).

To remove Network Manager and instead use the older Network service to start the network:

yum remove NetworkManager
service network start
chkconfig network on

After a reboot to test, ppp0 (and the other interfaces) came up fine. Beauty!

1 Mar, 2011  |  Written by  |  under Uncategorized

I’ve had a few goes at getting dynamic dns name resolution working on my DHCP home network, but could never get it right.

I realised today I really should have it working to make my life much easier with the move to IPv6 shortly, and to get Synergy working with my new computer setup.

A quick search found this excellent page giving the full steps to enable Dynamic DNS with DHCP. Easy to follow instructions and using it I got it all working very quickly.

The only change I had to make was to remove the domain name after ddns-domain-name in dhcpd.conf (thanks Jeffery Forman). Otherwise it gave an error. Works fine without the domain name though.

My Steps

$ dnssec-keygen -a hmac-md5 -b 128 -n USER dhcpupdate
$ cat Kdhcpupdate*.key

edit /etc/named.conf

ddns-update-style interim;
update-static-leases on;

key dhcpupdate {
algorithm hmac-md5;
secret “YOURKEYGOESHERE”;
# example:
# secret “N8Hk2RUFO84bEVl3uGTD2A==”;
};
zone “home” {
type master;
file “master/db-home”
allow-update { key dhcpupdate; };
};

zone “0.168.192.in-addr.arpa” {
type master;
file “master/db-home_rev”;
allow-update { key dhcpupdate; };
};

And editing /etc/dhcp/dhcpd.conf

key dhcpupdate {
algorithm hmac-md5
secret N8Hk2RUFO84bEVl3uGTD2A==;
}

zone 0.168.192.in-addr.arpa {
primary dns.home;
key dhcpupdate;
}

zone home {
primary dns;
key dhcpupdater;
}

subnet 192.168.1.0 netmask 255.255.255.0 {
option domain-name “home”;
ddns-domainname;
….
}