How To Configure Dynamic DNS (Fedora Core 4 Setup)

on November 11 | in Linux | by | with 39 Comments

In this howto we will learn how to build a Dynamic DNS Server. Normally when we configure DNS, we use static entries to resolve any FQDN. If we are using DHCP in our network which gives dynamic IPs to every computer that turns on or requests one, then it is not possible to configure DNS statically. For that we should configure our DNS with DHCP in a manner that whenever a computer gets a new IP, its FQDN will be automatically updated with the new IP in DNS.

1 Installation of Packages

Fedora Core 4 contains a DNS (Bind) and DHCP (dhcp) packages in its CDs. You can install it from the Fedora Core 4 CDs or download it from the internet using following command.

yum –y install bind bind-chroot bind-utils bind-libs caching-nameserver dhcp

where

bind —– DNS Server Package
bind-chroot —– DNS runs in chroot (jail) environment.
bind-libs —– Libraries needed in using bind, bind-utils
bind-utils —– Contains utilities like nslookup, host, dig etc.
caching-nameserver —– give caching capabilities to store records in cache.
dhcp —– Dynamic Host Configuration Protocol Package.

2 Configuring BIND (DNS)

You need to tell BIND that it is okay to allow other applications to update it. I added the following to my BIND configuration, everything else was left as stock Fedora Core 4. Here is my local zone details, suitably modified. Here I let BIND know which domains it can update; in my case I only have one domain to deal with. I am also loading the shared secret key at this stage. My DHCP server and DNS server are on the same box, so here I am only allowing localhost to perform the update. The file rndckey is a file containing a shared secret, so that BIND knows that it is an approved application sending instructions.

vi /etc/named.conf

controls {
inet 127.0.0.1 allow {localhost; } keys { “rndckey”; };
};
// Add local zone definitions here.
zone “example.com” {
type master;
file “example.com.zone”;
allow-update { key “rndckey”; };
notify yes;
};
zone “0.168.192.in-addr.arpa” {
type master;
file “0.168.192.in-addr.arpa.zone”;
allow-update { key “rndckey”; };
notify yes;
};

include “/etc/bind/rndc.key”;

The secret key is created at the installation time. No need to do anything here but….
Note: If your DHCP and DNS servers are on separate machines you need to copy the file between them. Both machines should use the same file i.e. /etc/rndc.key.

2.1  Zone Files

Set up your zone databases as normal. You do not need to do anything fancy. Because our DHCP server will update zone files as the new IP allocated to our workstation.

vi /var/named/chroot/var/named/example.com.zone

$TTL 86400
@       IN      SOA     @ root (
50 ; serial
28800 ; refresh (8 hours)
7200 ; retry (2 hours)
604800 ; retire (1 week)
86400 ; ttl (1 day)
)
IN      NS      server
server     IN      A       192.168.0.1

vi /var/named/chroot/var/named/0.168.192.in-addr.arpa.zone

$TTL 86400
@       IN      SOA     @ root (
50 ; serial
28800 ; refresh (8 hours)
7200 ; retry (2 hours)
604800 ; retire (1 week)
86400 ; ttl (1 day)
)
IN      NS      server
1      IN   PTR    server.example.com.

Now make shortcuts of these files in the /var/named directory with the same name.

cd /var/named
ln –s /var/named/chroot/var/named/example.com.zone example.com.zone
ln –s /var/named/chroot/var/named/0.168.192.in-addr.arpa.zone 0.168.192.in-addr.arpa.zone

3 Configuring DHCP Server

By default the DHCP server shipped in Fedora Core 4 does not do dynamic DNS update. You simply need to enable it. Below are the options I selected for my system. My dhcp configuration is as follows:

vi /etc/dhcpd.conf

# This is the communication zone

zone example.com. {
primary 127.0.0.1;
key rndckey;
}

default-lease-time      21600;  # 6 hours
max-lease-time          43200;  # 12 hours

# Client configuration:

option domain-name      “example.com.”;
option ip-forwarding    off;

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.200;
option routers                  192.168.0.1;  # default gateway
option subnet-mask              255.255.255.0;
option broadcast-address        192.168.0.255;
option domain-name-servers      192.168.0.1;

zone  0.168.192.in-addr.arpa. {
primary 192.168.0.2;
key rndckey;
}

zone localdomain. {
primary 192.168.0.2;
key rndckey;
}

}

Now execute the following change permission commands to enable named user to write the zone files whenever an name with IP updating is required.

chmod 770 /var/named/chroot/var/named
chmod 770 /var/named

Now start the services of dns and dhcp with the following command:

service named start
service dhcp start

Go to your client computers and enable them to take an IP from a DHCP server. With the following command check if your client computer name is updated in DNS. It will resolve your name with the newly allocated IP.

nslookup yourcomputername.example.com

Good Luck with your newly created Dynamic DNS Server.

pixelstats trackingpixel
Pin It

related posts

39 Responses to How To Configure Dynamic DNS (Fedora Core 4 Setup)

  1. Tauseef says:

    how to bind macaddress and ip in dhcp??

  2. You have to define a configuration in your dhcpd.conf like this before last }
    host machine1 {
    hardware ethernet XX:XX:XX:XX:XX:XX;
    fixed-address 192.XXX.XXX.XXX;
    }
    Where machine1 can be any name, make it suitable for you to identify the computer and replace XX with appropriate data.
    Regards,

  3. Tauseef says:

    i have done for a single ip & mac…the its done….but when i have doing for 2nd ip & mac,….then its failed

  4. Again do the same
    ##############
    host machine2 {
    hardware ethernet YY:YY:YY:YY:YY:YY;
    fixed-address 192.YYY.YYY.YYY;
    }
    #############
    Where machine2 can be any name, make it suitable for you to identify the computer and replace YY with appropriate value.
    Regards,

  5. Tauseef says:

    ya….thank u sir….its done….

  6. Tauseef says:

    hi,,sir….i want to configure my NIS client on fedora 10…so plz can u tell me how i configure my NIS client in fedora….i have configured NIS client on RHEL5 but problem in Fedora 10.. i am not getting proepr file..where i do entry?

  7. Its in
    /etc/ypbind.conf
    Just to define your NIS server address in it and restart ypbind service.

    Regards,

  8. Zulqarnain Ali says:

    Hello Sir!
    can you please tell me how to configure DNS server in RHEL 5. i am new to linux and i have tried to configure it but i dont know what exactly to do. i can find the file called named.conf. please tell me how to install it and configure it. i will be very thankful to you for this.

  9. Kaiser Khalil says:

    Sir,
    if my DHCP is running from dsl router,is it still possible to setup DDNS in fedora?because my senario is same and im confused how to setup DDNS.I have successfully setup DNS but i want to make life easy from manual enteries and i know everything is possible in linux world.

  10. hardik says:

    how to configure DDNS server in rhel5

  11. Rashid Iqbal says:

    Sir,

    I install the full cd of CentOS in VMWare. after that I install the dns packages through above give command except -y switch.
    but after doing all this I didnot find the “/etc/named.conf”
    file

    where it is………..?

  12. @Rashid: Create the new file /etc/named.conf, you can get the sample file from /usr/share/doc/bind*/
    ———-
    Regards,

  13. Rashid Iqbal says:

    AOA, sir,

    very good morning

    sir I want to configure my CENTOS as domain controller
    CentoS is installed in VMWare workstation 6.0.

    please guide me.

    Regard,

    Rashid

  14. rashid says:

    Dear sir,

    Here I am attaching my samba configuration file.

    in workgroup setup it was working fine but when I edit it as primary domain controller

    after that unable to join the client machine to the domain named ” saudivalves.com”

    username: root
    password: professional

    giving me the error: “error occured attempting to joing the domain saudivalves.com, unknown username or bad password”

    kindly help me to solve out this issue.

    Thanks sir,

    Rashid

    below is my smb.conf file
    —————————————–
    workgroup = saudivalves.com
    netbios name = centos
    encrypt passwords = yes
    security = user
    os level =65
    preferred master = yes
    domain master = yes
    local master = yes
    domain logons = yes
    logon path = \\%n\profile\%u
    logon drive = q:
    logon home = \\adnan\%u
    path = /var/lib/samba/netlogon
    guest ok = yes
    writeable = no
    share modes = no

    [home]
    read only = no
    browseable = no

    [music]

    path = /software
    browseable = yes

    [everyone]

    path = /var
    readonly = no
    browseable = yes

    —————————————-

  15. Rashid Iqbal says:

    sir configure the dns
    but getting error:

    host not found :computer name”

    configuration files shown below:

    gedit /etc/named.conf

    ********************************
    controls {
    inet 127.0.0.1 allow { localhost; }
    keys { rndckey; };
    };

    include “/etc/rndc.key”;

    options {
    directory “/var/named/”;
    };

    zone “.” {
    type hint;
    file “named.ca”;
    };

    zone “0.0.127.in-addr.arpa” {
    type master;
    file “0.0.127.in-addr.arpa.zone”;

    allow-update { none; };
    };

    zone “12.168.192.in-addr.arpa” {
    type master;
    file “12.168.192.in-addr.arpa.zone”;
    allow-update { none; };
    };

    zone “localhost” {
    type master;
    file “localhost.zone”;
    allow-update { none; };
    };

    zone “saudivalves.com” {
    type master;
    file “saudivalves.com.zone”;
    allow-update { none; };
    };

    *****************************

    after that

    vi /var/named/saudivalves.com.zone

    ******************************
    $TTL 86400
    $ORIGIN saudivalves.com.
    @ IN SOA centos.saudivalves.com.
    (
    50 ; serial
    28800 ; refresh
    7200 ; retry
    604800 ; expire
    86400 ; ttl
    )

    @ IN NS centos.saudivalves.com.
    centos IN A 192.168.12.3
    rashid IN A 192.168.12.8
    #www IN CNAME mainserver

    ***************************

    and the reverse lookup file is

    vi /var/named/12.168.192.in-addr.arpa.zone

    ****************************
    $TTL 86400
    @ IN SOA centos.saudivalves.com.
    (
    50 ; serial
    28800 ; refresh (8 hours)
    7200 ; retry (2 hours)
    604800 ; retire (1 week)
    86400 ; ttl (1 day)
    )
    @ IN NS centos.saudivalves.com.
    3 IN PTR centos.saudivalves.com.
    8 IN PTR adnan.saudivalves.com.

    ************************

    after that when I giving ping command getting below mentioned error:

    [root@centos named]#ping centos.saudivalves.com
    ping: unknown host centos.saudivalves.com

    kindly help me solve out this issue.

    Regards,

    Rashid

  16. @rashid: did you give right nameserver in your /etc/resolve.conf…..
    and what /var/log/messages says when you load your named
    ——–
    Regards,

  17. Rashid Iqbal says:

    vi /etc/resolv.conf

    *********************
    search saudivalves.com

    nameserver 192.168.12.1
    *************************8

    and the vi /var/log/messages

    *******************************
    May 24 14:31:56 centos named[5526]: starting BIND 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2 -u named -c /etc/named.caching-nameserver.conf -t /var/named/chroot
    May 24 14:31:56 centos named[5526]: adjusted limit on open files from 1024 to 1048576
    May 24 14:31:56 centos named[5526]: found 1 CPU, using 1 worker thread
    May 24 14:31:56 centos named[5526]: using up to 4096 sockets
    May 24 14:31:56 centos named[5526]: loading configuration from ‘/etc/named.caching-nameserver.conf’
    May 24 14:31:56 centos named[5526]: using default UDP/IPv4 port range: [1024, 65535]
    May 24 14:31:56 centos named[5526]: using default UDP/IPv6 port range: [1024, 65535]
    May 24 14:31:56 centos named[5526]: listening on IPv6 interface lo, ::1#53
    May 24 14:31:56 centos named[5526]: listening on IPv4 interface lo, 127.0.0.1#53
    May 24 14:31:56 centos named[5526]: command channel listening on 127.0.0.1#953
    May 24 14:31:56 centos named[5526]: command channel listening on ::1#953
    May 24 14:31:56 centos named[5526]: the working directory is not writable
    May 24 14:31:56 centos named[5526]: zone 0.in-addr.arpa/IN/localhost_resolver: loaded serial 42
    May 24 14:31:56 centos named[5526]: zone 0.0.127.in-addr.arpa/IN/localhost_resolver: loaded serial 1997022700
    May 24 14:31:56 centos named[5526]: zone 255.in-addr.arpa/IN/localhost_resolver: loaded serial 42
    May 24 14:31:56 centos named[5526]: zone 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN/localhost_resolver: loaded serial 1997022700
    May 24 14:31:56 centos named[5526]: zone localdomain/IN/localhost_resolver: loaded serial 42
    May 24 14:31:56 centos named[5526]: zone localhost/IN/localhost_resolver: loaded serial 42
    May 24 14:31:56 centos named[5526]: running
    May 24 14:38:00 centos avahi-daemon[3721]: Invalid query packet.
    May 24 14:42:39 centos last message repeated 6 times
    May 24 14:42:40 centos last message repeated 2 times
    May 24 14:42:54 centos avahi-daemon[3721]: Withdrawing address record for 192.168.12.3 on eth0.
    May 24 14:42:54 centos avahi-daemon[3721]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.12.3.
    May 24 14:42:54 centos avahi-daemon[3721]: iface.c: interface_mdns_mcast_join() called but no local address available.
    May 24 14:42:54 centos avahi-daemon[3721]: Interface eth0.IPv4 no longer relevant for mDNS.
    May 24 14:42:54 centos avahi-daemon[3721]: Withdrawing address record for fe80::20c:29ff:fee8:6887 on eth0.
    May 24 14:42:54 centos avahi-daemon[3721]: Leaving mDNS multicast group on interface eth0.IPv6 with address fe80::20c:29ff:fee8:6887.
    May 24 14:42:54 centos avahi-daemon[3721]: iface.c: interface_mdns_mcast_join() called but no local address available.
    May 24 14:42:54 centos avahi-daemon[3721]: Interface eth0.IPv6 no longer relevant for mDNS.
    May 24 14:42:56 centos avahi-daemon[3721]: New relevant interface eth0.IPv6 for mDNS.
    May 24 14:42:56 centos avahi-daemon[3721]: Joining mDNS multicast group on interface eth0.IPv6 with address fe80::20c:29ff:fee8:6887.
    May 24 14:42:56 centos avahi-daemon[3721]: Registering new address record for fe80::20c:29ff:fee8:6887 on eth0.
    May 24 14:42:59 centos avahi-daemon[3721]: New relevant interface eth0.IPv4 for mDNS.
    May 24 14:42:59 centos avahi-daemon[3721]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.12.3.
    May 24 14:42:59 centos avahi-daemon[3721]: Registering new address record for 192.168.12.3 on eth0.
    May 24 14:43:02 centos named[5526]: shutting down: flushing changes
    May 24 14:43:02 centos named[5526]: stopping command channel on 127.0.0.1#953
    May 24 14:43:02 centos named[5526]: stopping command channel on ::1#953
    May 24 14:43:02 centos named[5526]: no longer listening on ::1#53
    May 24 14:43:02 centos named[5526]: no longer listening on 127.0.0.1#53
    May 24 14:43:02 centos named[5526]: exiting
    May 24 14:43:05 centos named[6215]: starting BIND 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2 -u named -c /etc/named.caching-nameserver.conf -t /var/named/chroot
    May 24 14:43:05 centos named[6215]: adjusted limit on open files from 1024 to 1048576
    May 24 14:43:05 centos named[6215]: found 1 CPU, using 1 worker thread
    May 24 14:43:05 centos named[6215]: using up to 4096 sockets
    May 24 14:43:05 centos named[6215]: loading configuration from ‘/etc/named.caching-nameserver.conf’
    May 24 14:43:05 centos named[6215]: using default UDP/IPv4 port range: [1024, 65535]
    May 24 14:43:05 centos named[6215]: using default UDP/IPv6 port range: [1024, 65535]
    May 24 14:43:05 centos named[6215]: listening on IPv6 interface lo, ::1#53
    May 24 14:43:05 centos named[6215]: listening on IPv4 interface lo, 127.0.0.1#53
    May 24 14:43:05 centos named[6215]: command channel listening on 127.0.0.1#953
    May 24 14:43:05 centos named[6215]: command channel listening on ::1#953
    May 24 14:43:05 centos named[6215]: the working directory is not writable
    May 24 14:43:05 centos named[6215]: zone 0.in-addr.arpa/IN/localhost_resolver: loaded serial 42
    May 24 14:43:05 centos named[6215]: zone 0.0.127.in-addr.arpa/IN/localhost_resolver: loaded serial 1997022700
    May 24 14:43:05 centos named[6215]: zone 255.in-addr.arpa/IN/localhost_resolver: loaded serial 42
    May 24 14:43:05 centos named[6215]: zone 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN/localhost_resolver: loaded serial 1997022700
    May 24 14:43:05 centos named[6215]: zone localdomain/IN/localhost_resolver: loaded serial 42
    May 24 14:43:05 centos named[6215]: zone localhost/IN/localhost_resolver: loaded serial 42
    May 24 14:43:05 centos named[6215]: running
    May 24 14:44:29 centos system-config-network[6302]: -+ //etc/modprobe.conf eth0 alias vmxnet
    May 24 14:44:29 centos system-config-network[6302]: chmod 0644 //etc/sysconfig/networking/devices/ifcfg-eth0
    May 24 14:44:29 centos nm-system-settings: ifcfg-rh: updating /etc/sysconfig/network-scripts/ifcfg-eth0
    May 24 14:44:40 centos avahi-daemon[3721]: Withdrawing address record for 192.168.12.3 on eth0.
    May 24 14:44:40 centos avahi-daemon[3721]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.12.3.
    May 24 14:44:40 centos avahi-daemon[3721]: iface.c: interface_mdns_mcast_join() called but no local address available.
    May 24 14:44:40 centos avahi-daemon[3721]: Interface eth0.IPv4 no longer relevant for mDNS.
    May 24 14:44:40 centos avahi-daemon[3721]: Withdrawing address record for fe80::20c:29ff:fee8:6887 on eth0.
    May 24 14:44:40 centos avahi-daemon[3721]: Leaving mDNS multicast group on interface eth0.IPv6 with address fe80::20c:29ff:fee8:6887.
    May 24 14:44:40 centos avahi-daemon[3721]: iface.c: interface_mdns_mcast_join() called but no local address available.
    May 24 14:44:40 centos avahi-daemon[3721]: Interface eth0.IPv6 no longer relevant for mDNS.
    May 24 14:44:42 centos avahi-daemon[3721]: New relevant interface eth0.IPv4 for mDNS.
    May 24 14:44:42 centos avahi-daemon[3721]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.12.3.
    May 24 14:44:42 centos avahi-daemon[3721]: Registering new address record for 192.168.12.3 on eth0.
    May 24 14:44:42 centos avahi-daemon[3721]: New relevant interface eth0.IPv6 for mDNS.
    May 24 14:44:42 centos avahi-daemon[3721]: Joining mDNS multicast group on interface eth0.IPv6 with address fe80::20c:29ff:fee8:6887.
    May 24 14:44:42 centos avahi-daemon[3721]: Registering new address record for fe80::20c:29ff:fee8:6887 on eth0.
    May 24 14:45:44 centos nm-system-settings: ifcfg-rh: updating /etc/sysconfig/network-scripts/ifcfg-eth0
    May 24 14:49:38 centos last message repeated 2 times
    May 24 14:49:39 centos nm-system-settings: ifcfg-rh: updating /etc/sysconfig/network-scripts/ifcfg-eth0
    May 24 14:49:54 centos avahi-daemon[3721]: Withdrawing address record for 192.168.12.3 on eth0.
    May 24 14:49:54 centos avahi-daemon[3721]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.12.3.
    May 24 14:49:54 centos avahi-daemon[3721]: iface.c: interface_mdns_mcast_join() called but no local address available.
    May 24 14:49:54 centos avahi-daemon[3721]: Interface eth0.IPv4 no longer relevant for mDNS.
    May 24 14:49:54 centos avahi-daemon[3721]: Withdrawing address record for fe80::20c:29ff:fee8:6887 on eth0.
    May 24 14:49:54 centos avahi-daemon[3721]: Leaving mDNS multicast group on interface eth0.IPv6 with address fe80::20c:29ff:fee8:6887.
    May 24 14:49:54 centos avahi-daemon[3721]: iface.c: interface_mdns_mcast_join() called but no local address available.
    May 24 14:49:54 centos avahi-daemon[3721]: Interface eth0.IPv6 no longer relevant for mDNS.
    May 24 14:49:56 centos avahi-daemon[3721]: New relevant interface eth0.IPv4 for mDNS.
    May 24 14:49:56 centos avahi-daemon[3721]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.12.3.
    May 24 14:49:56 centos avahi-daemon[3721]: Registering new address record for 192.168.12.3 on eth0.
    May 24 14:49:57 centos avahi-daemon[3721]: New relevant interface eth0.IPv6 for mDNS.
    May 24 14:49:57 centos avahi-daemon[3721]: Joining mDNS multicast group on interface eth0.IPv6 with address fe80::20c:29ff:fee8:6887.
    May 24 14:49:57 centos avahi-daemon[3721]: Registering new address record for fe80::20c:29ff:fee8:6887 on eth0.
    May 24 14:50:10 centos nm-system-settings: ifcfg-rh: updating /etc/sysconfig/network-scripts/ifcfg-eth0
    May 24 14:50:11 centos nm-system-settings: ifcfg-rh: updating /etc/sysconfig/network-scripts/ifcfg-eth0
    May 24 14:50:13 centos avahi-daemon[3721]: Withdrawing address record for 192.168.12.3 on eth0.
    May 24 14:50:13 centos avahi-daemon[3721]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.12.3.
    May 24 14:50:13 centos avahi-daemon[3721]: iface.c: interface_mdns_mcast_join() called but no local address available.
    May 24 14:50:13 centos avahi-daemon[3721]: Interface eth0.IPv4 no longer relevant for mDNS.
    May 24 14:50:13 centos avahi-daemon[3721]: Withdrawing address record for fe80::20c:29ff:fee8:6887 on eth0.
    May 24 14:50:13 centos avahi-daemon[3721]: Leaving mDNS multicast group on interface eth0.IPv6 with address fe80::20c:29ff:fee8:6887.
    May 24 14:50:13 centos avahi-daemon[3721]: iface.c: interface_mdns_mcast_join() called but no local address available.
    May 24 14:50:13 centos avahi-daemon[3721]: Interface eth0.IPv6 no longer relevant for mDNS.
    May 24 14:50:15 centos avahi-daemon[3721]: New relevant interface eth0.IPv4 for mDNS.
    May 24 14:50:15 centos avahi-daemon[3721]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.12.3.
    May 24 14:50:15 centos avahi-daemon[3721]: Registering new address record for 192.168.12.3 on eth0.
    May 24 14:50:15 centos avahi-daemon[3721]: New relevant interface eth0.IPv6 for mDNS.
    May 24 14:50:15 centos avahi-daemon[3721]: Joining mDNS multicast group on interface eth0.IPv6 with address fe80::20c:29ff:fee8:6887.
    May 24 14:50:15 centos avahi-daemon[3721]: Registering new address record for fe80::20c:29ff:fee8:6887 on eth0.
    May 24 14:50:44 centos nm-system-settings: ifcfg-rh: updating /etc/sysconfig/network-scripts/ifcfg-eth0
    May 24 14:50:45 centos nm-system-settings: ifcfg-rh: updating /etc/sysconfig/network-scripts/ifcfg-eth0
    May 24 14:50:46 centos avahi-daemon[3721]: Withdrawing address record for 192.168.12.3 on eth0.
    May 24 14:50:46 centos avahi-daemon[3721]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.12.3.
    May 24 14:50:46 centos avahi-daemon[3721]: iface.c: interface_mdns_mcast_join() called but no local address available.
    May 24 14:50:46 centos avahi-daemon[3721]: Interface eth0.IPv4 no longer relevant for mDNS.
    May 24 14:50:46 centos avahi-daemon[3721]: Withdrawing address record for fe80::20c:29ff:fee8:6887 on eth0.
    May 24 14:50:46 centos avahi-daemon[3721]: Leaving mDNS multicast group on interface eth0.IPv6 with address fe80::20c:29ff:fee8:6887.
    May 24 14:50:46 centos avahi-daemon[3721]: iface.c: interface_mdns_mcast_join() called but no local address available.
    May 24 14:50:46 centos avahi-daemon[3721]: Interface eth0.IPv6 no longer relevant for mDNS.
    May 24 14:50:49 centos avahi-daemon[3721]: New relevant interface eth0.IPv4 for mDNS.
    May 24 14:50:49 centos avahi-daemon[3721]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.12.3.
    May 24 14:50:49 centos avahi-daemon[3721]: Registering new address record for 192.168.12.3 on eth0.
    May 24 14:50:49 centos avahi-daemon[3721]: New relevant interface eth0.IPv6 for mDNS.
    May 24 14:50:49 centos avahi-daemon[3721]: Joining mDNS multicast group on interface eth0.IPv6 with address fe80::20c:29ff:fee8:6887.
    May 24 14:50:49 centos avahi-daemon[3721]: Registering new address record for fe80::20c:29ff:fee8:6887 on eth0.
    *******************************

    and when I

    ping localhost

    it pings.

    small mistake or configuration somewhere

  18. Rashid says:

    Now I am implementing the DNS on individual machine

    configure properly but giving below mentioned error when restarting the named server.

    [root@mainserver named]# service named restart
    Stopping named: [ OK ]
    Starting named:
    Error in named configuration:
    zone 0.0.127.in-addr.arpa/IN: loading master file 0.0.127.in-addr.arpa.zone: file not found
    _default/0.0.127.in-addr.arpa/IN: file not found
    dns_rdata_fromtext: 12.168.192.in-addr.arpa.zone:2: near eol: unexpected end of input
    12.168.192.in-addr.arpa.zone:4: unknown RR type ‘7200’
    zone 12.168.192.in-addr.arpa/IN: loading master file 12.168.192.in-addr.arpa.zone: unexpected end of input
    _default/12.168.192.in-addr.arpa/IN: unexpected end of input
    zone localhost/IN: loaded serial 1
    dns_rdata_fromtext: mydomain.com.zone:3: near eol: unexpected end of input
    mydomain.com.zone:5: unknown RR type ‘7200’
    zone mydomain.com/IN: loading master file mydomain.com.zone: unexpected end of input
    _default/mydomain.com/IN: unexpected end of input
    [FAILED]

    ******************************************************
    named.conf
    ————-
    //
    // sample BIND configuration file
    //

    options {
    // tell named where to find files mentioned below
    directory “/var/named”;
    // on a multi-homed host, you might want to tell named
    // to listen for queries only on certain interfaces
    listen-on { 127.0.0.1; 10.11.12.0/24; };
    };

    // The single dot (.) is the root of all DNS namespace, so
    // this zone tells named where to start looking for any
    // name on the Internet
    zone “.” IN {
    // a hint type means that we’ve got to look elsewhere
    // for authoritative information
    type hint;
    file “named.root”;
    };

    // Where the localhost hostname is defined
    zone “localhost” IN {
    // a master type means that this server needn’t look
    // anywhere else for information; the localhost buck
    // stops here.
    type master;
    file “localhost.zone”;
    // don’t allow dynamic DNS clients to update info
    // about the localhost zone
    allow-update { none; };
    };

    // Where the 127.0.0.0 network is defined
    zone “0.0.127.in-addr.arpa” IN {
    type master;
    file “revp.127.0.0”;
    allow-update { none; };
    };

    zone “mydomain.com” IN {
    // this is the authoritative server for
    // schroder.net info
    type master;
    file “mydomain.com.zone”;
    };

    zone “12.168.192.in-addr.arpa” {
    // this is the authoritative server for
    // the 10.11.12.0 network
    type master;
    file “revp.12.168.192”;
    };

    —————————————-

  19. Rashid says:

    gedit /var/spool/mail/root

    —————————————-
    **Unmatched Entries**
    /etc/named.conf:3: unknown option ‘keys’: 1 Time(s)
    /etc/named.conf:4: missing ‘;’ before ‘}’: 3 Time(s)
    /var/named/12.168.192.rev:4: unknown RR type ‘1M’: 2 Time(s)
    /var/named/mydomain.com.zone:4: unknown RR type ‘1M’: 2 Time(s)
    12.168.192.in-addr.arpa.zone:4: unknown RR type ‘7200’: 2 Time(s)
    12.168.192.in-addr.arpa.zone:6: unknown RR type ‘7200’: 1 Time(s)
    _default/ 0.0.127.in-addr.arpa/IN: file not found: 1 Time(s)
    _default/0.0.127.in-addr.arpa/IN: file not found: 2 Time(s)
    _default/12.168.192.in-addr.arpa/IN: unexpected end of input: 5 Time(s)
    _default/localhost/IN: file not found: 1 Time(s)
    _default/mydomain.com/IN: file not found: 1 Time(s)
    _default/mydomain.com/IN: unexpected end of input: 4 Time(s)
    dns_rdata_fromtext: /var/named/12.168.192.rev:2: near eol: unexpected end of input: 2 Time(s)
    dns_rdata_fromtext: /var/named/mydomain.com.zone:2: near eol: unexpected end of input: 2 Time(s)
    dns_rdata_fromtext: 12.168.192.in-addr.arpa.zone:2: near eol: unexpected end of input: 2 Time(s)
    dns_rdata_fromtext: 12.168.192.in-addr.arpa.zone:4: near eol: unexpected end of input: 1 Time(s)
    dns_rdata_fromtext: mydomain.com.zone:3: near eol: unexpected end of input: 2 Time(s)
    mydomain.com.zone:5: unknown RR type ‘7200’: 2 Time(s)

    ———————- Named End ————————-

  20. Rashid says:

    interesting thing happened

    uninstall all the bind packages then reinstall the BIND packages
    using below command
    yum install bind bind-utils caching-nameserver bind-libs

    restart the system

    ping mainserver.mydomain.com
    pinging …………..

    WHY………………………………

  21. Rashid Iqbal says:

    sir still waiting for the files

  22. Rashid says:

    /etc/named.conf

    *******************************
    include “/etc/rndc.key”;

    controls {
    inet 127.0.0.1 allow { localhost; } keys { “rndc-key”; };
    };

    options {
    allow-recursion { 127.0.0.1; 192.168.1.1; }; // 192.168.1.1 is the LAN interface of internally connected network
    /* make named use port 53 for the source of all queries, to allow
    * firewalls to block all ports except 53:
    */

    // query-source port 53;

    /* We no longer enable this by default as the dns posion exploit
    has forced many providers to open up their firewalls a bit */

    // Put files that named is allowed to write in the data/ directory:
    directory “/var/named”; // the default
    pid-file “/var/run/named/named.pid”;
    dump-file “data/cache_dump.db”;
    statistics-file “data/named_stats.txt”;
    /* memstatistics-file “data/named_mem_stats.txt”; */
    };

    logging {
    /* If you want to enable debugging, eg. using the ‘rndc trace’ command,
    * named will try to write the ‘named.run’ file in the $directory (/var/named”).
    * By default, SELinux policy does not allow named to modify the /var/named” directory,
    * so put the default debug log file in data/ :
    */
    channel default_debug {
    file “data/named.run”;
    severity dynamic;
    };
    };

    acl “safe-subnet” { 192.168.1.0/24 ; };

    view “localhost_resolver” {
    /* This view sets up named to be a localhost resolver ( caching only nameserver ).
    * If all you want is a caching-only nameserver, then you need only define this view:
    */
    match-clients { 127.0.0.0/24; safe-subnets; };
    match-destinations { localhost; safe-subnets; };
    recursion yes;

    zone “.” IN {
    type hint;
    file “/var/named/named.ca”;
    };

    zone “mydomain.com” {

    type master;
    file “/var/named/mydomain.com.zone”;
    };

    zone “1.168.192.in-addr.arpa” {
    type master;
    file “/var/named/192-168-1.zone”;
    };

    *******************************************

    /var/named/mydomain.com.zone

    ———————
    $TTL 3D

    @ IN SOA mainserver.mydomain.com. hostmaster.mydomain.com.

    (

    200211152
    3600
    3600
    3600
    3600

    )

    localhost A 127.0.0.1
    mainserver A 192.168.1.1
    rashid A 192.168.1.2

    ————————————-

    /var/named/192-168-1.zone

    ———————–

    $TTL 3D

    @ IN SOA mainserver.mydomain.com. hostmaster.mydomain.com.

    (

    200303301
    8H
    2H
    4W
    1D

    )

    1 PTR mainserver.mydomain.com
    2 PTR rashid.mydomain.com

    ————————————–

    service named restart

    SUCCESSFULLY RESTARTED THE SERVICE

    —————
    [root@mainserver named]# dig centos.com

    ; <> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2 <> centos.com
    ;; global options: printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 14759
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

    ;; QUESTION SECTION:
    ;centos.com. IN A

    ;; ANSWER SECTION:
    centos.com. 86400 IN A 87.106.187.200

    ;; AUTHORITY SECTION:
    centos.com. 172800 IN NS ns65.1und1.de.
    centos.com. 172800 IN NS ns66.1und1.de.

    ;; ADDITIONAL SECTION:
    ns65.1und1.de. 76603 IN A 195.20.224.210
    ns66.1und1.de. 76603 IN A 212.227.123.58

    ;; Query time: 419 msec
    ;; SERVER: 192.168.12.1#53(192.168.12.1)
    ;; WHEN: Wed May 26 14:34:40 2010
    ;; MSG SIZE rcvd: 122

    IN THIRD LAST LINE HE IS SHOWING THE IP OF THAT INTERFACE THAT IS CONNECTED TO ROUTER.

    ——————-

    [root@mainserver named]# ping rashid.mydomain.com
    PING rashid.mydomain.com (216.34.94.184) 56(84) bytes of data.

    — rashid.mydomain.com ping statistics —
    5 packets transmitted, 0 received, 100% packet loss, time 4008ms

    [root@mainserver named]# dig rashid.mydomain.com

    ; <> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.2 <> rashid.mydomain.com
    ;; global options: printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53633
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 0

    ;; QUESTION SECTION:
    ;rashid.mydomain.com. IN A

    ;; ANSWER SECTION:
    rashid.mydomain.com. 290 IN A 216.34.94.184

    ;; AUTHORITY SECTION:
    mydomain.com. 524 IN NS ns3.mydomain.com.
    mydomain.com. 524 IN NS ns1.mydomain.com.
    mydomain.com. 524 IN NS ns4.mydomain.com.
    mydomain.com. 524 IN NS ns2.mydomain.com.

    ;; Query time: 37 msec
    ;; SERVER: 192.168.12.1#53(192.168.12.1)
    ;; WHEN: Wed May 26 14:36:21 2010
    ;; MSG SIZE rcvd: 125
    ———————————–

  23. Rashid Iqbal says:

    sir waiting for your kind reply

  24. Rashid Iqbal says:

    vi /var/named/chroot/etc/named.conf
    options {
    directory “/var/named”;
    dump-file “data/cache_dump.db”;
    statistics-file “data/named_stats.txt”;
    memstatistics-file “data/named_mem_stats.txt”;
    version “currently unavailable”;
    };

    zone “mydomain.com” in {
    type master;
    file “mydomain.com.ns”;
    allow-update { none; };
    };

    zone “12.168.192.in-addr.arpa” in {
    type master;
    file “12-168-192.in-addr.arpa.ns”;
    allow-update { none; };
    };

    vi /var/named/chroot/var/named/mydomain.com.ns
    ****
    $TTL 1d

    @ IN SOA ns.mydomain.com. root (
    ;mydomain.com. IN SOA ns.mydomain.com. hostmaster.mydomain.com. (
    2010031500 ; se = serial number
    3h ; ref = refresh
    15m ; ret = update retry
    3w ; ex = expiry
    3h ; min = minimum
    )

    IN NS ns.mydomain.com.

    ; private hosts
    IN NS 192.168.12.3

    ns IN A 192.168.12.3
    fish IN A 192.168.12.4
    whale IN A 192.168.12.5
    monkey IN A 192.168.12.6
    horse IN A 192.168.12.7
    cow IN A 192.168.12.8
    mainserver IN A 192.168.12.2

    ***********************

    vi /var/named/chroot/var/named/12-168-192.in-addr.arpa.ns

    *******
    $TTL 1d
    @ IN SOA ns.mydomain.com. hostmaster.mydomain.com. (
    2010031500 ; se = serial number
    3h ; ref = refresh
    15m ; ret = update retry
    3w ; ex = expiry
    3h ; min = minimum
    )

    @ IN NS ns.mydomain.com.

    ; private hosts, reverse lookup
    3 IN PTR ns.mydomain.com.

    2 IN PTR mainserver.mydomain.com.
    3 IN PTR centos.mydomain.com.
    4 IN PTR fish.mydomain.com.
    5 IN PTR whale.mydomain.com.
    6 IN PTR monkey.mydomain.com.
    7 IN PTR horse.mydomain.com.
    8 IN PTR cow.mydomain.com.

    ****************************************
    the error is

    [root@centos etc]# nslookup 192.168.12.2
    Server: 192.168.12.3
    Address: 192.168.12.3#53

    2.12.168.192.in-addr.arpa name = mainserver.mydomain.com.

    [root@centos etc]# nslookup mainserver
    Server: 192.168.12.3
    Address: 192.168.12.3#53

    ** server can’t find mainserver: NXDOMAIN

    [root@centos etc]#

    kindly guide.

    Best Regards,

  25. Shah Jehan says:

    Dear Sir,

    I want to configur DNS in Rathat 9. I have 2 host name. for example.

    hotmail.com
    yahoo.com

    IP behind ns1.hotmail.com and ns1.yahoo.com is same for example 192.168.1.4

    Secoundly my web and mail server IP is 192.168.1.3 and the access link is mail.yahoo.com and mail.hotmail.com.

    Thiredly my FTP is also configured on IP 192.168.1.2

    Can you please Guied me that how is set my DNS server.
    Thanks and regards,
    Shah Jehan

  26. Hello Sohail bai I am tariq (INARA) from Peshawar. How are doing. Your web page is wonderfull help for linux lovers. I like it. Good job man.

  27. Shah Jehan says:

    Hello, Tariq, Yar da oovaya chi thaso kam yooo Tariq yeye. Linux wala chi baad kei VU kei waye. I am searching Tariq Linux wala which were working in VU.

  28. hello says:

    ‘/etc/named.caching-nameserver.conf’

  29. hello says:

    ‘/etc/named.caching-nameserver.conf’
    ‘default_debug’

  30. hello says:

    ‘/etc/named.caching-nameserver.conf’
    ‘default_debug’
    ‘/etc/named.caching-nameserver.conf’
    ‘default_debug’

  31. holmes says:

    I did everything and dns starts with zero problems, but dhcpd gives me this type of error in every zone statement :

    /etc/dhcpd.conf line 21: expecting a parameter or declaration. zone
    ^

    Can you please help me, i’ve been trying to make it work for a month and nothing seems fix de issue…..

  32. rashid says:

    can you please attach your dhcpd.conf file

  33. holmes says:

    thanks,,for answering , here is the dhcpd.conf file..

    ———————————————————————————-

    shared-network arnaldo-net {

    #Parametros globales…

    option routers 190.162.107.1;
    option subnet-mask 255.255.255.0;
    option domain-name “arnaldo.cl”;
    option domain-name-servers 190.162.107.250;
    option broadcast-address 190.162.107.255;
    option time-offset -04000;
    default-lease-time 21600;
    max-lease-time 43200;

    authoritative;
    ddns-updates on;
    ddns-update-style intermin;
    ddns-domainname “arnaldo.cl”;
    ddns-rev-domainname “in-addr.arpa”;
    include “/etc/rndc.key”;
    allow client-updates;

    zone arnaldo.cl. {
    primary 127.0.0.1;
    key rndcley;
    }

    #Configuracion de la subred especifica….

    subnet 190.162.107.0 netmask 255.255.255.0 {

    range 190.162.107.5 190.162.107.10;

    zone 107.162.190.in-addr.arpa. {
    primary 190.162.107.250;
    key rndckey;
    }

    zone localdomain. {
    primary 190.162.107.250;
    key rndckey;
    }

    }
    }

    ———————————————————————————

    as i told you the error is

    /etc/dhcpd.conf line 21: expecting a parameter or declaration. zone
    ^

    and its like that in every ddns related statement

    /etc/dhcpd.conf line 21: expecting a parameter or declaration.
    ddns-updates on;
    ^

    etc…etc….

    i hope you can help mee….thanks…

  34. rashid says:

    line # 20 the keyword rndckey and while defining the localdomain I think there is . at the end of localdomain word check this as well
    You can get the sample dhcpd.conf file
    http://www.semicomplete.com/files/dynamic-dns-with-dhcp/dhcpd.conf

    have a look to this config file as well

    Regards,

    Rashid

Leave a Reply

Your email address will not be published. Required fields are marked *

« »