How to configure DNS in CentOS

CentOS administration
CentOS DNS configuration
DNS configuration
Linux configuration
Red Hat Enterprise Linux
How do I configure DNS in CentOS?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Here is a tutorial on setting up the various network aspects of Cent OS, including DNS setup. You might find this site helpful as well.
Good Luck!

Discuss This Question: 5  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • SaadKhan
    Hello, In Centos 5 DNS can we configured by modifying the resolv.conf file and defining the DNS in it like: Example: nameserver Once applied reboot the system it'll work.
    15 pointsBadges:
  • petkoa
    Hi Jeetendra, I'll try to systematize the discusion alittle ;o) So, what do you intend to accomplish on your CentOS box - (a) to get domain names resolved for the box, (b) to get them resolved for a number of hosts on your network, or (c) to run a DNS server for your zone (or yours and some slave zones)? (a) If you want just domain names resolved for the box, just edit /etc/resolv.conf as SaadKhan suggested, you don't need even to reboot, the changes are "active" immediately... If, however, you get IP address by DHCP, and the server-pushed DNS server is not working for you, make sure that dhcpcd or whatever DHCP client you have will not overwrite /etc/resolv.conf. This is the default behavior of the DHCP clients and for good reason. Look at the client man pages which startup parameters to use ( -R is the cli switch for dhcpcd) (b) If you want domain names resolved for the hosts on your network, you will run a caching DNS server, which is much the same as (c), but without setting up zone files... so go to (c). In fact, there have to be some RPMs with a caching server "out of the box", so you can opt to use them (and better do). (c) If you want to set up a DNS server, first create /etc/named.conf with the necessary settings for your server (logging; security - keys and ACLs; views - external and internal, if you need them; and finally, zone files locations) and the zone files... Here you can use the second link Flame provided, and also man pages for your version of bind (named, the nameserver) and RFC for zone file format (I can't cite RFC numbers, but you'll find them in bind documentation). I hope this will be of some help, Good luck, Petko
    3,140 pointsBadges:
  • Servercentos
    how to change dns server for client at server centos os?i already change at system-administrations-network-dns server.but at client not change anything.
    10 pointsBadges:
  • Chippy088
    @linkhochoo please try to only include sites that are relevant to the question. Your link is of no use to IT related questions.
    4,625 pointsBadges:
  • Michael Tidmarsh
    65,700 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: