Setting up a DNS record

Issues related to applications and software problems
Post Reply
Kunwar
Posts: 55
Joined: 2014/08/28 23:21:43

Setting up a DNS record

Post by Kunwar » 2015/05/09 12:58:36

I have a centos service that is running bind (named) on it... I use this server to manage the network... I have squid installed on this service in transparent mode that helps me enforce network policies. However when in transparent mode squid fails to filter https request. So I am trying to make a fake DNS record that resolves all the request for facebook.com to the loopback address or something else.

I have added following lines in named.conf

Code: Select all

zone "facebook.com" {
type master;
file "/var/named/facebook.com.db";
};
and the file facebook.com.db contains

Code: Select all

$TTL 86400

@ IN SOA ns1.facebook.com. useremail.facebook.com. (
	
	2001062501 ; serial

	10800	; refresh (3 hours)

	3600	; retry (1 hour)

	604800	;expire after 1 week

	3600 	;minimum TTL 1 hour

)

IN	NS	ns1.facebook.com.
IN	NS	ns2.facebook.com
IN 	MX	10	mail.facebook.com.

	IN 	A	127.0.0.1
mail	IN 	A	127.0.0.1
www 	IN 	CNAME	facebook.com.
ns1	IN	A	127.0.0.1
ns2	IN 	A	10.0.0.1

When I run named-checkzone facebook.com. /facebook.com.db I get the following. It tells me that there are errors but I am not sure how to eliminate the errors:

Code: Select all

[root@parada named]# named-checkzone facebook.com. /facebook.com.db
zone facebook.com/IN: loading from master file /facebook.com.db failed: file not found
zone facebook.com/IN: not loaded due to errors.

Last edited by Kunwar on 2015/05/10 17:00:22, edited 1 time in total.

scottro
Forum Moderator
Posts: 2556
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: Setting up a DNS record

Post by scottro » 2015/05/09 13:51:17

Do you get any useful information with (while in the directory containing the zone file)

named-checkzone facebook.com ./facebook.com.db

I also wonder if it's because you have a different DNS server in /etc/resolv.conf that is getting information on the real facebook.com elsewhere, assuming that facebook.com is the actual name of the zone file.)
New users should check the FAQ and Read Me First pages

Kunwar
Posts: 55
Joined: 2014/08/28 23:21:43

Re: Setting up a DNS record

Post by Kunwar » 2015/05/11 07:59:13

When I run named-checkzone facebook.com. /facebook.com.db I get the following. It tells me that there are errors but I am not sure how to eliminate the errors:

Code: Select all

[root@parada named]# named-checkzone facebook.com. /facebook.com.db
zone facebook.com/IN: loading from master file /facebook.com.db failed: file not found
zone facebook.com/IN: not loaded due to errors.


User avatar
TrevorH
Site Admin
Posts: 33218
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Setting up a DNS record

Post by TrevorH » 2015/05/11 08:06:59

You missed the leading . on the filename so it's looking for it in / not ./
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Kunwar
Posts: 55
Joined: 2014/08/28 23:21:43

Re: Setting up a DNS record

Post by Kunwar » 2015/05/11 21:59:14

Thank you Trevor for pointing that out I used the "." and was able to find the error. Now the record has been sent and even on HTTPS the DNS directs then to a dead page. I was trying to block the website through Squid transparent proxy but this is what I came up with.

Post Reply