Sunday, November 18, 2018

domain name system - Setting up a dns server on CentOs 5.8



I'm having some problems with setting up my dns server on my vps (CentOs 5.8 32 bit)



I have configured a dns zone with the ISPConfig 3 wizard.
My name servers are registered at my domain registrar (at Yahoo)



I configured my domain to use my name servers:




ns1.mydomain.com
ns2.mydomain.com


Still, when I go to my domain, it says page not found.






The real error is "can't find domainname.com"







named.conf (in /var/named/chroot/etc)



//
// Sample named.conf BIND DNS server 'named' configuration file
// for the Red Hat BIND distribution.
//
// See the BIND Administrator's Reference Manual (ARM) for details, in:
// file:///usr/share/doc/bind-*/arm/Bv9ARM.html

// Also see the BIND Configuration GUI : /usr/bin/system-config-bind and
// its manual.
//
options
{
// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;


// Put files that named is allowed to write in the data/ directory:
directory "/var/named"; // the default
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;
};
};
//

// All BIND 9 zones are in a "view", which allow different zones to be served
// to different types of client addresses, and for options to be set for groups
// of zones.
//
// By default, if named.conf contains no "view" clauses, all zones are in the
// "default" view, which matches all clients.
//
// If named.conf contains any "view" clause, then all zones MUST be in a view;
// so it is recommended to start off using views to avoid having to restructure
// your configuration files in the future.

//

Answer



There is something wrong with the configuration of the DNS server software on your server. This can be seen from the following DNS diagnosis questions.



You domain is correctly delegated (dig ns uk2be.com):



;; QUESTION SECTION:
;uk2be.com. IN NS


;; ANSWER SECTION:
uk2be.com. 172800 IN NS ns1.uk2be.com.
uk2be.com. 172800 IN NS ns2.uk2be.com.


The glue records are existing (dig ns1.uk2be.com and dig ns2.uk2be.com), although it's a single server:



;; QUESTION SECTION:
;ns1.uk2be.com. IN A


;; ANSWER SECTION:
ns1.uk2be.com. 172726 IN A 46.37.174.74

------

;; QUESTION SECTION:
;ns2.uk2be.com. IN A

;; ANSWER SECTION:
ns2.uk2be.com. 172714 IN A 46.37.174.74



But your DNS server is not responding to any query (dig soa uk2be.com @46.37.174.74 or dig www.uk2be.com @46.37.174.74):



; <<>> DiG 9.7.3 <<>> soa uk2be.com @46.37.174.74
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 24146
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0


;; QUESTION SECTION:
;uk2be.com. IN SOA

;; Query time: 21 msec
;; SERVER: 46.37.174.74#53(46.37.174.74)
;; WHEN: Fri Aug 17 18:30:18 2012
;; MSG SIZE rcvd: 27

------


; <<>> DiG 9.7.3 <<>> www.uk2be.com @46.37.174.74
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 21070
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.uk2be.com. IN A

;; Query time: 17 msec

;; SERVER: 46.37.174.74#53(46.37.174.74)
;; WHEN: Fri Aug 17 18:30:48 2012
;; MSG SIZE rcvd: 31


Providing your server is actually using this IP address (46.37.174.74), something is wrongly configured on your DNS software. Which DNS software are you using? Can you see anything wrong in the logs?



For testing purposes, you might want to try a few online tools:





No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...