Saturday, May 30, 2015

How to set up DNS for scan ip's

[root@vm32 ~]# nslookup abc-scan
;; connection timed out; no servers could be reached



1. check dnsmasq installed or not
[root@vm32 ~]# rpm -qa|grep -i dnsmasq
dnsmasq-2.48-4.el6.x86_64

2. create new file /etc/racdns and add below entry for  dnsmasq

[root@vm32 ~]# cat /etc/racdns
192.168.0.37   abc-scan.domain.com        abc-scan
192.168.0.38   abc-scan.domain.com        abc-scan
192.168.0.39   abc-scan.domain.com        abc-scan


cat /etc/dnsmasq.conf | grep addn-hosts
addn-hosts=/etc/racdns


3. Start dnsmasq

service dnsmasq start
chkconfig dnsmasq on


4.

# Generated by NetworkManager
search domain.com


# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
nameserver 127.0.0.1
nameserver 192.168.1.1


5.chattr +i /etc/resolv.conf

Verify:

[root@vm32 ~]# nslookup abc-scan
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   abc-scan.domain.com
Address: 192.168.0.39
Name:   abc-scan.domain.com
Address: 192.168.0.37
Name:   abc-scan.domain.com
Address: 192.168.0.38
Name:   abc-scan.domain.com
Address: 192.168.0.39
Name:   abc-scan.domain.com
Address: 192.168.0.38
Name:   abc-scan.domain.com
Address: 192.168.0.37

No comments: