DNS

All posts in the DNS category

DynDNS Client configuration on Linux systems

Published December 16, 2013 by Siva

What is DynDNS:

As you know any domain should be pointed to an IP in order to be seen in browsers. If you don’t have a connection to the internet with static IP (cable, DSL, etc.), then it becomes tedious to set an A record for your domain every time your IP changes. Dynamic DNS is a feature that will allow you to point a domain name to any IP and the changes are almost immediate.

For example, you have a server at home and host a website on your computer. But you don’t have a static IP, that is the IP changes each time you reconnect to the Internet, you can setup Dynamic DNS for the domain.

Download from the below link:

http://sourceforge.net/projects/ddclient/

INSTALLATION:

1)   cp ddclient /usr/sbin/
2) mkdir /etc/ddclient
3)  cp sample-etc_ddclient.conf /etc/ddclient/ddclient.conf
 4)  vi /etc/ddclient/ddclient.conf
  — and change hostnames, logins, and passwords appropriately

Example :

  ## For those using Redhat style rc files and using daemon-mode:
  cp sample-etc_rc.d_init.d_ddclient /etc/rc.d/init.d/ddclient
  ## enable automatic startup when booting
  /sbin/chkconfig –add ddclient
  ## start the first time by hand
  /etc/rc.d/init.d/ddclient start

  ## If you are not using daemon-mode, configure cron and dhcp or ppp
  ## as described below.
protocol=namecheap
use=web, web=checkip.dyndns.com/, web-skip=’IP Address’
server=dynamicdns.park-your-domain.com
login=mydomain.com
password=’XXXXXXXXXXXXXXXXXXXXXX’

# I need to update for my subdomain
mysubdomain

Debug :

ddclient -daemon=0 -debug -verbose -noquiet

Cache file location :

/var/cache/ddclient/ddclient.cache

Force update:

ddclient –force

API:

http://dynamicdns.park-your-domain.com/update?host=Mysubdomain&domain=mydomain.com&password=XXXXXXXXXXXX&ip=100.1.1.1

 

—– End —

How to install DNS server on CentOS 5.

Published February 18, 2010 by Siva

In the first time, you must download core software of this service, that are

  1. bind
  2. caching-nameserver
  3. bind-chroot

You can download this software by this command,

# yum -y install bind caching-nameserver bind-chroot

After you downloaded , you can setup follow this instruction :

1. Check your hostname by this command :

# uname -n
dns.aoddy.com

2. Edit /etc/named.conf

options {
directory “/var/named”;
forwarders {WWW.XXX.YYY.ZZZ;}; // IP of ISP
// query-source address * port 53;
allow-query { localhost; 192.168.0.0/24;};
// query range
allow-transfer { localhost; 192.168.0.0/24;};
// transfer range
allow-recursion { localhost; 192.168.0.0/24;};
// recursion range
};
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
// here is the section for internal informationsview “internal” {
match-clients {
localhost;
192.168.0.0/24;
};
zone “.” IN {
type hint;
file “named.ca”;
};
zone “mysite.com” IN {
// for common resolving
type master;
file “mysite.com.fwd”;
allow-update { none; };
};
zone “0.168.192.in-addr.arpa” IN {
// for reverse resolving *note
type master;
file “mysite.com.rev”;
allow-update { none; };
};
zone “localdomain” IN {
type master;
file “localdomain.zone”;
allow-update { none; };
};

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

zone “0.0.127.in-addr.arpa” IN {
type master;
file “named.local”;
allow-update { none; };
};

zone “255.in-addr.arpa” IN {
type master;
file “named.broadcast”;
allow-update { none; };
};

zone “0.in-addr.arpa” IN {
type master;
file “named.zero”;
allow-update { none; };
};

};

// here is the section for external informations
view “external” {
match-clients {
any;
};

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

zone “server-linux.info” IN {
// for common resolvin
type master;
file “server-linux.info.wan”;
allow-update { none; };

};

zone “80.0.16.172.in-addr.arpa” IN {
// for reverse resolving *note
type master;
file “80.0.16.172.db”;
allow-update { none; };
};
};
include “/etc/rndc.key”;

2. Create /var/named/mysite.com.fwd


$TTL 86400
@ IN SOA dns.mysite.com. root.aoddy.com.(
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS dns.mysite.com.
IN MX 10 dns.mysite.com.
IN MX 20 web.mysite.com.
IN A 192.168.0.2
dns IN A 192.168.0.2
web IN A 192.168.0.3

3. Create file /var/named/aoddy.com.rev


$TTL 86400
@ IN SOA dns.aoddy.com. root.mysite.com.(
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS dns.aoddy.com.
IN MX 10 dns.mysite.com.
IN MX 20 web.mysite.com

IN PTR dns.mysite.com.
2 IN PTR dns.mysite.com.
3 IN PTR web.mysite.com.

4. Start service

# service named restart

5. Test this server can resolve domain&ip

[root@dns named]# nslookup
> dns.mysite.com
Server: 192.168.0.2
Address: 192.168.0.2#53
Name: dns.mysite.com
Address: 192.168.0.2
> 192.168.0.2
Server: 192.168.0.2
Address: 192.168.0.2#53

2.0.168.192.in-addr.arpa name = dns.mysite.com.
>

6. If your service can’t resolve , you can check on your file config by this command :

# named-checkconf