Showing posts with label DNS. Show all posts
Showing posts with label DNS. Show all posts

Installing DNS server on CentOS 5

1 comments
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#53Name: 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

DNS not working for a domain in a plesk panel (Windows)

0 comments
Symptom:
When you are in dedicated Box of windows and using a plesk and you are getting a page not found for a domain name while other domains are working fine in a same box.
All the setting you think are fine and even name server are pointing well then there is a chance of DNS misconfig

Resolution: Editing the Plesk DNS zone database

When the DNS zone for a domain is managed via Plesk, the status for this domain in the dns_zone table of the database is temporarily set to a value of 2 (to lock it for any further changes) and is then set back to a value of 0 value when the changes are processed. If for some reason the process is interrupted (Plesk restarts for example) the status field value may not get changed back to 0 and stays as 2. Therefore any changes are no longer recorded until the status is changed back to 0.

Please note: to isolate database issues with Plesk and your own web services (MySQL or MS SQL), we recommend and setup Plesk to use MS Access databases. If you have setup Plesk to use MySQL or MS SQL databases you will need to use your preferred database viewer to find the necessary DNS zone table. You can view MS SQL instructions below.

  1. To view and edit the Plesk DNS zone database you will need to use an MS Access database viewer such as MDBPlus, and then open up the pleskmain.db located at:C:\Program Files (x86)\Parallels\Plesk\admin\db – Note: password is the same as Plesk admin login.

  2. Check dns_zone records for the problem domain’s entry (domain.com for example):

    1. if there are multiple entries for the same domain; remove the entry that has the incorrect setting of 2;

    2. if there is only one entry for the domain, adjust the value in the “status” column from 2 back to 0.



  3. Save the database.

  4. Go back into Plesk and navigate to the DNS zone settings tab for the affected domain.

  5. Select “Restore Defaults” to rebuild the appropriate entries for the domain


You should now be able to resolve the domain correctly.

For Plesk installations setup to use MS SQL as the default Plesk database:

  1. Login via MSSQL Server Management Studio Express or your preferred MS SQL management tool.

  2. Expand the Plesk database.

  3. Expand the “tables” section.

  4. Scroll down to “dbo.dns_zone“, right-click on this and choose “open table”

  5. Delete or modify the erroneous entry as in Step 2. above.

Configuring DNS for Internet access in Windows Server 2003

0 comments
The stand-alone server running Windows Server 2003 becomes a DNS server for your network. In the first step, you assign this server a static Internet Protocol (IP) address. DNS servers must not use dynamically assigned IP addresses because a dynamic change of address could cause clients to lose contact with the DNS server.

Step 1: Configure TCP/IP



  1. Click Start, point to Control Panel, point to Network Connections, and then click Local Area Connection.

  2. Click Properties.

  3. Click Internet Protocol (TCP/IP), and then click Properties.

  4. Click the General tab.

  5. Click Use the following IP address, and then type the IP address, subnet mask, and default gateway address in the appropriate boxes.

  6. Click Advanced, and then click the DNS tab.

  7. Click Append primary and connection specific DNS suffixes.

  8. Click to select the Append parent suffixes of the primary DNS suffix check box.

  9. Click to select the Register this connection's addresses in DNS check box.Note that DNS servers running Windows Server 2003 must point to themselves for DNS. If this server needs to resolve names from its Internet service provider (ISP), you must configure a forwarder. Forwarders are discussed in the How to Configure Forwarders section later in this article.

  10. Click OK three times.


NOTE: If you receive a warning from the DNS Caching Resolver service, click OKto dismiss the warning. The caching resolver is trying to contact the DNS server, but you have not finished configuring the server.

Step 2: Install Microsoft DNS Server



  1. Click Start, point to Control Panel, and then click Add or Remove Programs.

  2. Click Add or Remove Windows Components.

  3. In the Components list, click Networking Services (but do not select or clear the check box), and then click Details.

  4. Click to select the Domain Name System (DNS) check box, and then click OK.

  5. Click Next.

  6. When you are prompted, insert the Windows Server 2003 CD-ROM into the computer's CD-ROM or DVD-ROM drive.

  7. On the Completing the Windows Components Wizard page, click Finish when Setup is complete.

  8. Click Close to close the Add or Remove Programs window.


Step 3: Configure the DNS Server


To configure DNS by using the DNS snap-in in Microsoft Management Console (MMC), follow these steps:

  1. Click Start, point to Programs, point to Administrative Tools, and then clickDNS.

  2. Right-click Forward lookup zones, and then click New Zone

  3. When the New Zone Wizard starts, click Next.You are prompted for a zone type. The zone types include:

    • Primary zone: Creates a copy of a zone that can be updated directly on this server. This zone information is stored in a .dns text file.

    • Secondary zone: A standard secondary zone copies all of the information from its master DNS server. A master DNS server can be an Active Directory, primary, or secondary zone that is configured for zone transfers. Note that you cannot modify the zone data on a secondary DNS server. All of its data is copied from its master DNS server.

    • Stub zone: A Stub zone contains only those resource records that are necessary to identify the authoritative DNS servers for that zone. Those resource records include Name Server (NS), Start of Authority (SOA), and possibly glue Host (A) records.


    There is also an option to the store zone in Active Directory. This option is only available if the DNS server is a Domain controller.

  4. The new forward lookup zone must be a primary or an Active Directory-integrated zone so that it can accept dynamic updates. Click Primary, and then click Next.

  5. The new zone contains the locator records for this Active Directory-based domain. The name of the zone must be the same as the name of the Active Directory-based domain, or be a logical DNS container for that name. For example, if the Active Directory-based domain is named "support.microsoft.com", valid zone names are "support.microsoft.com" only.Accept the default name for the new zone file. Click Next.NOTE: Experienced DNS administrators may want to create a reverse lookup zone, and are encouraged to explore this branch of the wizard. A DNS server can resolve two basic requests: a forward lookup and a reverse lookup. A forward lookup is more common. A forward lookup resolves a host name to an IP address with an "A" or Host Resource record. A reverse lookup resolves an IP address to a host name with a PTR or Pointer Resource record. If you have your reverse DNS zones configured, you can automatically create associated reverse records when you create your original forward record.

How to flush DNS cache in Linux / Windows / Mac

0 comments
Flush dns to get a new name resolution. Also flush dns cache when you can’t access a newly registered domain name. You can simply flush your dns cache anytime to get new entry. So, Flush your dns cache now.
To flush DNS cache in Microsoft Windows (Win XP, Win ME, Win 2000, Win 98):-

- Start -> Run -> type cmd
- in command prompt, type ipconfig /flushdns
- Done! You Window DNS cache has just been flush.

How to clear DNS cache in vista.

1. Click the Microsoft Vista Start logo in the bottom left corner of the screen
2. Click All Programs
3. Click Accessories
4. RIGHT-click on Command Prompt
5. Select Run As Administrator
6. In the command window type the following and then hit enter: ipconfig /flushdns
7. You will see the following confirmation:

Windows IP Configuration
Successfully flushed the DNS Resolver Cache.


To flush the DNS cache in Linux, restart the nscd daemon:-


- To restart the nscd daemon, type /etc/rc.d/init.d/nscd restart in your terminal
- Once you run the command your linux DNS cache will flush.

To flush the DNS cache in Mac OS X:-

- type lookupd -flushcache in your terminal to flush the DNS resolver cache.
ex: bash-2.05a$ lookupd -flushcache
- Once you run the command your DNS cache (in Mac OS X) will flush.

Newer versions of MacOS X should use the following command:

type dscacheutil -flushcache

How to add domain (DNS) Wildcard/catchall entries with Zoneedit

0 comments

Problem


I’m now using Zone Edit to handle the zone record for new domains. It gives far more control over the zone, and is very quick with updates etc.  I needed to setup one particular domain so that all traffic to that it – and any subdomains – went to one IP address. A ‘catchall’ if you like.


For example: ‘myquickfix.co.uk’ and ‘www.myquickfix.co.uk’  have A records pointing to 82.109.178.44. If I needed the subdomain ‘pants.myquickfix.co.uk’ to point to that IP also, I could add a CNAME record, or another A record. But if I need lots of subdomains all pointing to the same IP, it’s far easier to add a wildcard A record.


Resolution


Wildcard entries are represented by an asterisk (*) and will send all requests that aren’t covered by other entries, to the specified IP. Shown below are the relevant ZoneEdit screens where this can be setup:



An asterisk is entered for Name, and the destination in Numperic IP


Note: There are already entries for the domain, ‘www’ and ‘mail’. But we want to add the wildcard / catchall record in the fields above ‘Add New IP Address’. By the way, this is done in the ‘IP Addresses (A)’  screen.



After the wildcard entry is added, it appears in the list


The entry now appears in the list. If you wait for a few minutes and try to browse to a random subdomain of your domain, it should work. Woo!


A few notes:


If you’ve tried the subdomain in your browser before adding the wildcard, you might get a 404 error or just a blank page because the browser has cached the result from lastime. To get around this, clear your browsers cache, and flush your DNS cache. In Windows this is done by opening a command prompt and typing: “ipconfig /flushdns”.


If you try and click on the link that appears with the asterisk in ZoneEdit, it is very unlikely to work. The browser will try and URL encode the address turning ‘*.domain.co.uk’ into ‘%2A.domain.co.uk’ and you’ll get an Invalid Hostname error (400).


Any thoughts? please comment.

Monitoring PowerDNS with MRTG

16 comments

Monitoring PowerDNS is easy with MRTG, just install these two packages and create a config file and you're good to go!



apt-get install libsnmp-session-perl mrtg

Add this to a config file, for example /etc/mrtg.cfg (pico /etc/mrtg.cfg)



Interval: 5
WorkDir: /var/www/mrtg
WriteExpires: yes
Options[_]: growright,nopercent
XSize[_]: 600

Target[udp-queries]: `/etc/init.d/pdns mrtg udp-queries udp-answers`
Options[udp-queries]: growright,nopercent,perminute
MaxBytes[udp-queries]: 600000
AbsMax[udp-queries]: 600000
Title[udp-queries]: Queries per minute
PageTop[udp-queries]: <h1>Queries per minute</h1>
WithPeak[udp-queries]: ymwd
YLegend[udp-queries]: queries/minute
ShortLegend[udp-queries]: q/m
LegendI[udp-queries]: udp-questions
LegendO[udp-queries]: udp-answers

Target[perc-failed]: `/etc/init.d/pdns mrtg udp-queries udp-answers`
Options[perc-failed]: growright,dorelpercent,perminute
MaxBytes[perc-failed]: 600000
AbsMax[perc-failed]: 600000
Title[perc-failed]: Queries per minute, with percentage success
PageTop[perc-failed]: <h1>Queries per minute, with percentage success</h1>
WithPeak[perc-failed]: ymwd
YLegend[perc-failed]: queries/minute
ShortLegend[perc-failed]: q/m
LegendI[perc-failed]: udp-questions
LegendO[perc-failed]: udp-answers

Target[packetcache-rate]: `/etc/init.d/pdns mrtg packetcache-hit udp-queries`
Options[packetcache-rate]: growright,dorelpercent,perminute
Title[packetcache-rate]: packetcache hitrate
MaxBytes[packetcache-rate]: 600000
AbsMax[packetcache-rate]: 600000
PageTop[packetcache-rate]: <h1>packetcache hitrate</h1>
WithPeak[packetcache-rate]: ymwd
YLegend[packetcache-rate]: queries/minute
ShortLegend[packetcache-rate]: q/m
LegendO[packetcache-rate]: total
LegendI[packetcache-rate]: hit

Target[packetcache-missrate]: `/etc/init.d/pdns mrtg packetcache-miss udp-queries`
Options[packetcache-missrate]: growright,dorelpercent,perminute
Title[packetcache-missrate]: packetcache MISSrate
MaxBytes[packetcache-missrate]: 600000
AbsMax[packetcache-missrate]: 600000
PageTop[packetcache-missrate]: <h1>packetcache MISSrate</h1>
WithPeak[packetcache-missrate]: ymwd
YLegend[packetcache-missrate]: queries/minute
ShortLegend[packetcache-missrate]: q/m
LegendO[packetcache-missrate]: total
LegendI[packetcache-missrate]: MISS

Target[latency]: `/etc/init.d/pdns mrtg latency`
Options[latency]: growright,nopercent,gauge
MaxBytes[latency]: 600000
AbsMax[latency]: 600000
Title[latency]: Query/answer latency
PageTop[latency]: <h1>Query/answer latency</h1>
WithPeak[latency]: ymwd
YLegend[latency]: usec
ShortLegend[latency]: usec
LegendO[latency]: latency
LegendI[latency]: latency

Target[recursing]: `/etc/init.d/pdns mrtg recursing-questions recursing-answers`
Options[recursing]: growright,nopercent,gauge
MaxBytes[recursing]: 600000
AbsMax[recursing]: 600000
Title[recursing]: Recursive questions/answers
PageTop[recursing]: <h1>Recursing questions/answers</h1>
WithPeak[recursing]: ymwd
YLegend[recursing]: queries/minute
ShortLegend[recursing]: q/m
LegendO[recursing]: recursing-questions
LegendI[recursing]: recursing-answers

Make mrtg create a new report every 5 minutes by adding the following line in crontab (type crontab -e):



0,5,10,15,20,25,30,35,40,45,50,55 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg.cfg

Create a summary page showing all graphs:



indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html

If using the default mrtg/apache configuration you can access the graphs here: http://yourserver/mrtg

Installing PowerDNS on etch/lenny

0 comments

The PowerDNS Nameserver is a modern, advanced and high performance authoritative-only nameserver. It is written from scratch and conforms to all relevant DNS standards documents. Furthermore, PowerDNS interfaces with almost any database.


This tutorial has been tested and is working on Debian etch and lenny


1. Install the PowerDNS server and MySql backend using apt



apt-get install pdns-server pdns-backend-mysql

2. Create a new database (or use existing) and execute the following SQL queries to create the PowerDNS table structure:



create table domains (
id INT auto_increment,
name VARCHAR(255) NOT NULL,
master VARCHAR(128) DEFAULT NULL,
last_check INT DEFAULT NULL,
type VARCHAR(6) NOT NULL,
notified_serial INT DEFAULT NULL,
account VARCHAR(40) DEFAULT NULL,
primary key (id)
)type=InnoDB;


CREATE UNIQUE INDEX name_index ON domains(name);

CREATE TABLE records (
id INT auto_increment,
domain_id INT DEFAULT NULL,
name VARCHAR(255) DEFAULT NULL,
type VARCHAR(6) DEFAULT NULL,
content VARCHAR(255) DEFAULT NULL,
ttl INT DEFAULT NULL,
prio INT DEFAULT NULL,
change_date INT DEFAULT NULL,
primary key(id)
)type=InnoDB;

CREATE INDEX rec_name_index ON records(name);
CREATE INDEX nametype_index ON records(name,type);
CREATE INDEX domain_id ON records(domain_id);



create table supermasters (
ip VARCHAR(25) NOT NULL,
nameserver VARCHAR(255) NOT NULL,
account VARCHAR(40) DEFAULT NULL
);

3. Configure PowerDNS to use the MySql backend by adding this line into the configuration file (pico /etc/powerdns/pdns.conf)



launch=gmysql

4. Configure MySql login information for the PowerDNS server that can read from the tables you created earlier by adding lines similar to these (pico /etc/powerdns/pdns.d/pdns.local)



gmysql-host=127.0.0.1
gmysql-user=pdns
gmysql-password=password
gmysql-dbname=pdns

Replace the username, password and dbname with a valid login information and database name.


5. Restart PowerDNS



/etc/init.d/pdns restart

Now you should have a fully functional PowerDNS server installed. To manage the database (adding zones and records), consider using the Poweradmin web-based administration tool.

DNS, FTP and Telnet

0 comments
This is a good an animated presentation to know about DNS, FTP and Telnet.

Have a look at this video.

nslookup

0 comments
Have a look at this video. It’s well explained about nslookup client.

How can I check to see if DNS is working ?

0 comments

Dont use “ping” to test DNS. Use tools called “nslookup” and “dig”.


Check to see whether or not your registrar is pointing your domain to the correct nameservers. The “whois” information is often wrong, and should not be used. Go to a command prompt/console and enter the command:




nslookup -type=NS yourdomainname.com


If the response does not contain all of the correct name servers, then you should contact your registrar and have them fix it.


Check to see whether a particular server is responding, you can add the server name:




nslookup www.yourdomainname.com ns1.yournameserver.com


If the response has a bunch of ‘root-servers’ that means the server does not know about the domain name and is referring you elsewhere.


To look for a certain record type, like the “MX” record or the “SOA” record, you can use the parameter “-type=MX” or “-type=SOA”.




nslookup -type=MX yourdomainname.com




Go_GrEen^ThiNk_GReeN~LoVE_GreEn – Pushkar

What is DNS Propagation?

0 comments
Once you make changes to your domain with the registrar you purchased your domain from, the changes will take anywhere from 1 to 72 hours for propagation to occur depending on your ISP and how often they update the DNS records.

Domain propagation is the process of your registrar handing off the changes of your domain to root DNS servers, ISPs acquire records from the root servers, ISPs to other ISPs and so on until you see the changes reflect on your computer with your internet service provider. Some service providers update their records more often than others and receive changes faster. As a result of this, often you will not be able to get to your website by its' domain name but a friend can. Simply wait out until the changes propagate to your ISP. In the meantime we provide you an IP and temporary address in your welcome email which allow you to start working on your site immediately!

How to Hide BIND version

0 comments

BIND (Berkeley Internet Name Domain) is the most commonly used DNS server on the Internet, especially on Unix-like systems.






Login as root to your sever.



Edit named.conf configuration:
# nano /etc/named.conf

If you find a options function add this line to it:
version “some version”;

If that function does not exist, just add it:
options {version “some version”;};

Save and Exit

Restart your BIND service to take the change.
# /etc/init.d/named restart

steps to view your Site Prior To DNS Propagation in HELM

0 comments
The below steps to view your Site Prior To DNS Propagation in HELM:-

1. Login to Helm and enter your domain name in the search box in the upper left hand corner
2. Click on the Domain Name
3. Click on the "Domain Aliases" Icon
4. Click "Add New" button. For the domain alias enter yourdomain.servername.net. For example, if your domain was genericbusiness.com and you are hosted on venus.secure-xp.net server, you would enter genericbusiness.venus.secure-xp.net
5. Click Save

How do I disable recursive DNS queries on cPanel server

0 comments
For linux (named DNS server) edit the named.conf file found in /etc/named.conf and add this line in the options clause:

recursion no;

Be sure to make a backup of named.conf before doing this.

Restart the named service

rndc reload

or

service named restart

Cannot edit DNS zone after cPanel update

0 comments
Issue :

After updating all the cPanel software, following error occurs when trying to Edit a DNS zone :

Unable to parse zone: Error while parsing zonedata for *DOMAIN NAME HERE*.com: expected valid rname, line 4 …propagated at /usr/local/cpanel/Cpanel/CPAN/Net/DNS/ZoneFile/Fast.pm line 142.

Fix :

The error means that the dns zone has invalid data in it and it cannot be loaded. So you need to recreate the zone to fix this.

You can use the following cPanel script to do this :

/scripts/pkgacct accountname ( just to backup the account)

/scripts/killdns domainname

/scripts/adddns –domain domainname

Please note that while recreating the domain using the above script it will not create the sub-domain. It will create the default DNS records. You can also specify the ip address using ” –ip X.X.X.X ” option

After running the scripts, you can manually add the entries for the sub-domains .