Cisco Router as DNS Server

howto build a Cisco DNS Server
some it's usefull, to use a Router as a DNS Server, you can create a full DNS Server function, and , if your clients use this server, to redircet connected clients to a Blackhole, or some other sites.
Turn on the DNS Server
	ip dns server
create a SOA record
	ip dns primary evilhaxor.com soa \ ns1.evilhaxor.com chw@evilhaxor.com 86400 3600 1209600 86400	
Creat Nameserver entries
	ip host evilhaxor.com ns ns1.evilhaxor.com
	ip host evilhaxor.com ns ns2.evilhaxor.com
Creat MX entries.
	ip host evilhaxor.com mx 10 mail.evilhaxor.com
	ip host evilhaxor.com mx 20 mail2.evilhaxor.com		
Create a entrie for your DNS Server pointet to your router (IP => routerip)
	ip host ns1.evilhaxor.com 192.168.2.156	
ans now,create entries for your server.
	ip host www.evilhaxor.com 192.168.2.10
	ip host ns2.evilhaxor.com 192.168.2.11
	ip host mail.evilhaxor.com 192.168.2.20
	ip host mail2.evilhaxor.com 192.168.2.2
Full Sample:
	ip dns server
	ip dns primary evilhaxor.com soa ns1.evilhaxor.com chw@evilhaxor.com 86400 3600 1209600 86400
	ip host evilhaxor.com mx 10 mail.evilhaxor.com
	ip host evilhaxor.com mx 20 mail2.evilhaxor.com
	ip host evilhaxor.com ns ns1.evilhaxor.com
	ip host evilhaxor.com ns ns2.evilhaxor.com
	ip host ns1.evilhaxor.com 192.168.2.156
	ip host www.evilhaxor.com 192.168.2.10
	ip host ns2.evilhaxor.com 192.168.2.11
	ip host mail.evilhaxor.com 192.168.2.20
	ip host mail2.evilhaxor.com 192.168.2.21
and now, you can create some Blackhole entries.
create your own favorite list.
	ip host www.microsoft.com 127.0.0.1
	ip host www.banner.com 127.0.0.1
	ip host ad.ch.doubleclick.net 127.0.0.1
and if you have ipv6 on the router
	ipv6 host cisco2600 2001:db8:0:1::2

Cisco IOS DNS Commands

Cisco Kron
ip name-server 	<dns-ip1> [[<dns-ip2>] ...]	Set Namserver (max. 6) 
no ip name-server <dns-ip1> [[<dns-ip2>] ...]	Delete One or more Nameserver
ip domain-name <domain>				Set Domain Name
ip domain-lookup				Enable Domain Lookup
no ip domain-lookup				Disable Domain Lookup
ip host <name> <ip1> [[<ip2>] ...]		Create Entry in the local Hosttable
no ip host <name>				Delete Entry in the local Hosttable

	
show hosts					Display Hostlist

(c) 2008 by packetlevel.ch / last update: 03.03.2009