หน้าเว็บ

แสดงบทความที่มีป้ายกำกับ dns แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ dns แสดงบทความทั้งหมด

วันจันทร์ที่ 9 พฤษภาคม พ.ศ. 2554

Howto set DNS Client on Solaris.

DNS Client Setup

แก้ไฟล์  /etc/resolv.conf 

# vi /etc/resolv.conf

Add the following lines to it:

search tot.co.th
nameserver 192.168.1.1

ซึ่ง,
  • nameserver IP :  คือ Primary  DNS server
  • search tot.co.th  : Default domain name to search. For example, if you type command nslookup www, it will search it as www.tot.co.th
Thanks : tech-recipes.com

วันศุกร์ที่ 9 ตุลาคม พ.ศ. 2552

Basic Sample DNS Configurations

A Record (Address Record)

Each of these records map a name to an IP address.

Example:

Name
TTL
Type
IP
www.dnsmadeeasy.com. 10800 A 192.168.1.2
  • Name - The www.dnsmadeeasy.com is the host.
  • TTL (time to live) - The 10800 indicates how often (in seconds) that this record will exist (will be cached) in other systems. The lower the number the more frequent systems will go to the DNS server for queries.
  • IP - 192.168.1.2 indicates the IP which this host will go to.
You are allowed multiple IPs per host for routing using "round robin" functionality. So the following is also valid:
Name
TTL
Type
IP
www.dnsmadeeasy.com. 10800 A 192.168.1.2
www.dnsmadeeasy.com. 10800 A 10.2.54.4

NOTE: It is important to know that only an A record can be made for your root host record. If you have a domain called example.com. and if you want an IP for example.com. then A record is the only valid solution for this. CNAME records are invalid.


Wildcard Record

Wildcard Records give you the ability to map all (or a section) of the records in your domain to one IP. All Wildcard records are created with A records.

If you create a record that is part of your domain (and inclusive of the wild card set) then only that record is directed to the other IP and everything else will goto the Wildcard record.

Example:
Name
TTL
Type
IP
*.dnsmadeeasy.com. 10800 A 192.168.1.2
www.dnsmadeeasy.com. 10800 A 10.2.54.4

The 'www' record would goto 10.2.54.4 but all of the other IPs would goto 192.168.1.2

All members can create Wildcard records for their domains.



Load Balancing / Round Robin

Load balancing / Round Robin allows you to distribute your server load evenly among multiple servers. This can all be handled in DNS Made Easy so you do not need to purchase expensive load balancers. The best part is that this service is "free" for all DNS Made Easy users!

All you have to do is create multiple A records with the same name but with a different IP / value.

Example:
Name
TTL
Type
IP
www.example.com. 10800 A 192.168.1.2
www.example.com. 10800 A 10.2.54.4

50% of the time a user would go to 192.168.1.2 and 50% of the time the users would go to 10.2.54.4.

You can even split the traffic to more hosts. For example:

  • If you have three (3) A records with the same name the traffic would be split evenly (33.333% to each host)
  • If you have four (4) A records with the same name the traffic would be split evenly (25% to each host).
  • etc.

NOTE: There is generally a limit of (thirteen) 13 hosts that you can round robined (13 A records with the same name and different values) due to the limitations of the UDP packet which is what the DNS protocol generally runs over.

You can even combine this service with our DNS Failover service to remove a server from the loop if it is down!


CNAME Record (Canonical Name Record)

These are usually referred to as alias records since they usually map an alias to its canonical name. The name server does handle these queries differently from an A record. When a name server looks up a name and finds a CNAME record, it replaces the name with the canonical name and looks up the new name. This allows you to point multiple systems to one IP without specifically assigning an A record to each host name. If your IP was ever to change you would only have to change one A record.

Example:

Name
TTL
Type
Data
www.dnsmadeeasy.com. 10800 A 192.168.1.2
ftp.dnsmadeeasy.com. 10800 CNAME www.dnsmadeeasy.com.

  • The A record is similar to the example above. Please read the section on A Records if this does not make sense to you.
  • Name - ftp.dnsmadeeasy.com is the host which are we are making an alias for.
  • TTL (time to live) - The 10800 indicates how often (in seconds) that this record will exist (will be cached) in other systems. The lower the number the more frequent systems will go to the DNS server for queries.
  • Data - www.dnsmadeeasy.com is the host which ftp.dnsmadeeasy.com is an alias to. It is important to realize that this value is never a CNAME value. This value should primarily be A record but could use an IP.

When the DNS server is queried for the ftp.dnsmadeeasy.com. system it realizes that it is an alias for www.dnsmadeeasy.com.. The system then returns the value of www.dnsmadeeasy.com.. which is 192.168.1.2. Whatever www.dnsmadeeasy.com. points to then so does ftp.dnsmadeeasy.com..

You can also use CNAME to point a record in one zone to a record in another zone. The following is valid:

Name
Expire Time
TYPE
Data / Value (A Record)
www.dnsmadeeasy.com. 10800 CNAME www.tiggee.com.

NOTE: It is important that CNAME always are to the left hand side. You should never make an alias to an alias. Or you should never use MX or NS records with CNAME records. You can read more about NS and MX records later in this document.

NOTE: It is important to know that only an A record can be made for your root host record. If you have a domain called example.com. and if you want an IP for example.com. then A record is the only valid solution for this. CNAME records are invalid.


NS Record (Name Server Record)

These records indicate which name servers are authoritative for the zone.

Example:

Name
TTL
Type
Data
ns.dnsmadeeasy.com. 10800 A 192.168.10.12
dnsmadeeasy.com. 10800 NS ns.dnsmadeeasy.com
  • The A record is similar to the example above. Please read the section on A Records if this does not make sense to you.
  • Name - dnsmadeeasy.com. is the domain which is being assigned an authoritative name server.
  • TTL (time to live) - The 10800 indicates the how often (in seconds) that this record will exist (will be cached) in other systems. The lower the number the more frequent systems will go to the DNS server for queries.
  • Data - ns.dnsmadeeasy.com. is the host which name servers will query for records in the dnsmadeeasy.com.. domain. It is important to realize that this value is never a CNAME value. This value should primarily be A record but could use an IP.

You can also use NS records to assign the authoritative name server for a subdomain.

Example:

Name
TTL
Type
Data (A Record)
sub.dnsmadeeasy.com. 10800 NS ns1.dnsmadeeasy.com.

Name servers will query ns1.dnsmadeeasy.com. for records in the sub.dnsmadeeasy.com. sub-domain


MX Record (Mail Exchange Record)

These records tell mail servers where to deliver mail. The name field of an MX record contains the host name which appears in the e-mail address, and the data field contains the hostname of the server to which the mail should be delivered. Two MX records that define the mail servers for the dnsmadeeasy.com domain might contain the following:

Name
Expire Time
Type
MX level
Data (A Record)
dnsmadeeasy.com. 10800 MX 10 mail.dnsmadeeasy.com.
dnsmadeeasy.com. 10800 MX 20 backupmail.dnsmadeeasy.com.

  • Name - Contains the domain dnsmadeeasy.com., meaning that these records are used for the entire domain. If the mail was addressed to username@dnsmadeeasy.com, the mail is directed to the mail exchangers defined by these records.
  • TTL (time to live) - The 10800 indicates the how often (in seconds) that this record will exist (will be cached) in other systems.
  • MX level - Sets the preference for the MX record. The mailserver will first try mail.dnsmadeeasy.com.. The lower the number the higher the preference. If the mail server with highest precedence is inaccessible the mail will be delivered to the mail server next in precedence. So if the server mail.dnsmadeeasy.com. is unavailable then backupmail.dnsmadeeasy.com. will get mail to be queued until mail.dnsmadeeasy.com. is ready to accept mail again. At that time backupmail.dnsmadeeasy.com will send it's queued mail to mail.dnsmadeeasy.com. Note: The email server must also be configured properly to queue mail for another system
  • Data - The host names which will have mail delivered to them for the domain. It is important to realize that this value is never a CNAME value. This value should primarily be A record but could use an IP.

HTTP Redirection Record

You can read all about the Redirection Service product here.

These are special records in that they are a combination of an A record and the use of an application server. There will be an A record pointing to our application servers which will redirect to the URL you specify.

HTTP Redirection Records allow you to map your FQDN to any URL of your choice.
For instance you can map. http://www.yourdomain.com
to
http://www2.yourdomain.com:9001/users/mypage.html

All users can create HTTP Redirection Records with any of the DNS Made Easy memberships.


TXT Record (Text Record)

These records are simply a list of strings, each less than 256 characters in length. TXT records can be used for anything you want.

Example Input for Domain Name: example.com
Name: mail
Data (TXT): This is the main mail server.
TTL: 1800 seconds

Result:
This will create a TXT record for the 'mail.example.com.' record and the description (text) of the record will be "This is the mail mail server.".


PTR Record (Pointer Record)

Pointer records are used to map a network interface (IP) to a host name. These are primarily used for reverse DNS.

Example Input for Domain Name: 1.168.192.in-addr.arpa
Name: 25
Data (PTR to): www.example.com.
TTL: 1800 seconds

Result:
This will create a reverse DNS entry for 192.168.1.25. The reverse DNS will be a pointer to 'www.example.com.'. This record will have a cache (TTL) of 30 minutes.

Of course 192.168.1.x is an internal network and would not be allowed in the DNS Made Easy system.


Thanks : dnsmadeeasy.com


DNS Server On Fedora Core 5

การติดตั้ง DNS Server ด้วย Fedora Core 5

การติดตั้ง DNS Server เพื่อใช้งานในเครือข่ายองค์กร และเครือข่ายอินเตอร์เน็ต ....

การติดตั้ง DNS Server ด้วย Fedora Core 5

1. ตรวจสอบ BIND packet ด้วยคำสั่ง ดังตัวอย่างนี้

[ root@kk ~ ]# rpm -qa bind
bind-9.3.2-4.1

ในการทดลองนี้ ได้ติดตั้งโปรแกรม BIND ไว้แล้วคือ bind-9.3.2-4.1 ซึ่งเป็นเวอร์ชั่น 9.3.2-4.1

2. หากยังไม่ได้ติดตั้งโปรแกรม BIND สามารถดาวน์โหลดได้ที่ http://fedora.redhat.com/download/ ซึ่งต้องดาวน์โหลดเป็นไฟล์ rpm และเป็น Fedora Core 5 หรือสูงกว่า เมื่อดาวน์โหลดเสร็จแล้ว ทำการติดตั้งด้วยคำสั่ง ดังตัวอย่างนี้

[ root@kk ~ ]# rpm -ivh bind-9.3.2-4.1.rpm

3. เพิ่มชื่อโดเมน และกลุ่ม IP address ที่ต้องการ ลงไปในไฟล์ named.conf ดังตัวอย่างนี้

3.1 ใช้คำสั่ง vi เพื่อแก้ไขไฟล์ named.conf ดังตัวอย่างนี้

[ root@kk ~ ]# vi /etc/named.conf

3.2 กดปุ่ม insert หรือ กด i เพื่อแทรกและแก้ไขข้อความ

3.3 จากนั้นเพิ่มกลุ่มโดเมนและ กลุ่มไอพีแอดเดรส ดังตัวอย่างนี้

zone "kk.koogle.com" IN {
type master;
file "koogle.com.zone";
allow-update { none; };
};

zone "0.168.192.in-addr.arpa" IN {
type master;
file "192.168.0.zone";
allow-update { none; };
};

3.4 บันทึกไฟล์ named.conf ด้วยคำสั่ง ดังนี้

3.4.1 กดปุ่ม Esc

3.4.2 ตามด้วยเครื่องหมาย : และ wq!

3.5 สร้างไฟล์ ossthailand.com.zone และไฟล์ 192.168.0.zone ดังตัวอย่างนี้

3.5.1 เข้าไปยังไดเรคเทอรี่ /var/named/chroot/var/named ดังตัวอย่างนี้

[ root@kk ~ ]# cd /var/named/chroot/var/named/

3.5.2 สร้างไฟล์ koogle.com.zone โดยการก๊อบบี้จากไฟล์ localhost.zone ดังตัวอย่างนี้

[ root@kk named ]# cp localhost.zone koogle.com.zone

3.5.3 สร้างไฟล์ 192.168.0.zone โดยการก๊อบบี้จากไฟล์ localhost.zone ดังตัวอย่างนี้

[ root@kk named ]# cp localhost.zone 192.168.0.zone

3.6 แก้ไขไฟล์ koogle.com.zone ดังตัวอย่างนี้

$TTL 86400
@ IN SOA kk.koogle.com. root.kk.koogle.com (
2007022201 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS kk.koogle.com
koogle.com. IN NS kk.koogle.com
koogle.com. IN MX 5 mail.koogle.com

kk IN A 192.168.0.7
data IN A 192.168.0.1

www IN CNAME kk
ftp IN CNAME kk

3.7 แก้ไขไฟล์ 192.168.0.zone ดังตัวอย่างนี้

$TTL 86400
@ IN SOA kk.koogle.com. root.kk.koogle.com. (
2007022201 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS kk.koogle.com

1 IN PTR data.koogle.com
7 IN PTR kk.koogle.com

3.8 เปิดการใช้งานโปรแกรม BIND ด้วยคำสั่ง ดังตัวอย่างนี้

[ root@kk named ]# /etc/init.d/named restart
Stopping named: [ OK ]
Starting named: [ OK ]

3.9 ทดสอบ Forward mapping ด้วยโปรแกรม BIND โดยคำสั่ง dig ดังตัวอย่างนี้

[ root@kk ~ ]# dig kk.koogle.com

3.9.1 โดยแสดงรายการดังนี้

; <<>> DiG 9.3.2 <<>> kk.koogle.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55458
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;kk.koogle.com. IN A

;; ANSWER SECTION:
kk.koogle.com. 86400 IN A 192.168.0.7

;; AUTHORITY SECTION:
koogle.com. 86400 IN NS kk.koogle.com.koogle.com.

;; Query time: 4 msec
;; SERVER: 192.168.0.7#53(192.168.0.7)
;; WHEN: Tue Mar 6 00:55:10 2007
;; MSG SIZE rcvd: 85

3.10 ทดสอบการทำงานโปรแกรม BIND ด้วยคำสั่ง nslookup ดังตัวอย่างนี้

[ root@kk ~ ]# nslookup
> kk.koogle.com <------- ใส่ชื่อโดเมนที่ต้องการตรวจสอบ
Server: 192.168.0.7
Address: 192.168.0.7#53
Name: cs.ossthailand.com
Address: 192.168.0.7


Thanks : kom.homelinux.org

How To Configure Dynamic DNS On Fedora

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

authoritative;
include "/etc/rndc.key";
# Server configuration:


server-identifier server;
ddns-domainname "example.com.";
ddns-rev-domainname "in-addr.arpa.";
ddns-update-style interim;
ddns-updates on;
ignore client-updates;


# 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.

Thansk : howtoforge.com