See if you are want to configure a DNS server then it is always better to use a static IP because in this way you can reserve the IP for DNS server but instead if you are using DHCP then there are chances that IP goes to someone else in you network which will lead to problems.
As I had tried with a static IP
But still if you want to continue with DHCP then
Code:
#ifconfig
for now let me take your machine's IP as 192.168.0.100
and your hostname localhost.localdomain.com
will show you your current IP address
This is the address which you will use in
Code:
/etc/resolv.conf
nameserver 192.168.0.100
nameserver (your primary DNS)
nameserver (your secondary DNS)
See the basic idea of using your IP in resolv.conf is because you are creating a local domain name which is not registered on internet so the DNS server which you are using will not recognize the domain name server which you are planning to create
So you need to assign your machines IP in resolv.conf to remove name resolution issue
So in the first option mention your machine's IP then the DNS servers which you are using as second and third option
In
Code:
/etc/hosts
192.168.0.100 localhost.localdomain.com
Same IP is to be used in /etc/hosts and /etc/resolv.conf