-2

I understand resolv.conf file is used by Linux to resolve DNS lookup but I cant figure if I need to edit this file in my case.

My Scenario:

I am not hosting the DNS on my vps machine. I have purchase Godaddy Premium DNS Service to set my A Records, mx etc.. My vps is only used to host 1 website where Nginx handles all incoming requests.

My Questions:

1) In my case where I am using Godaddy DNS service, do I still need to add the Nameserver resolution in resolv.conf file? Or does resolv.conf only applies if I am hosting my own DNS on my machine using BIND or something else?

2) The current resolv.conf file looks like this. In the ip address, does it mean I have to enter the Godaddy Nameserver's ip address here?

nameserver 123.00.00.123   <-- Is this Godaddy NS Ip address?

3) Which services uses this resolv.conf? I mean does Nginx, Postfix or ssh refer to the configuration in this file at all?

I've set everything else up and only now I came across resolv.conf by accident and I dont know if my set-up is incomplete without this info. Can someone help me understand this please?

Neel
  • 1,421
  • 7
  • 21
  • 35
  • I read the wikipedia link already. But I still cannot draw the conclusion if that only applies for VPS hosting DNS or does it apply to ALL VPS even when DNS is hosted elsewhere. Thats why I have posted this question here. Can you confirm atleast this for me? Do I use resolv.conf or not in my use-case? – Neel Jan 11 '15 at 08:06
  • As much as people love to downvote here, it doesnt help. I am obviously confused on this which I have already explained in my post and downvoting without taking that sec to post a quick comment still leaves me in the dark. If its an easy question for you all, please do tell me why that is instead of just downvoting so atleast I know. – Neel Jan 11 '15 at 08:14

1 Answers1

1

Every system needs to configure it's resolver, regardless if it's a DNS server or not. This is used by the core library of the OS which will be used whenever any service needs to resolve a name - they just use library function for it which uses this configuration (there might be exceptions when programs do this on their own, but this are rare special cases).

What this config file does is essentially to tell the system: OK, if you need to find out how to contact a machine where you know the name, ask the server listed here to get the IP address.

The current resolv.conf file looks like this. In the ip address, does it mean I have to enter the Godaddy Nameserver's ip address here?

Even if your own domain is hosted by GoDaddy, that doesn't mean at all that you have to use their DNS server. Instead, use the DNS server that your VPS provider tells you to use. DNS is a distributed database for a reason. In most cases, your own domain will quite unimportant for your server, but if it is, your providers DNS will either find out the name for you (if it's recursive) or tell your system "I don't know anything about that, ask this DNS server instead".

Read http://en.wikipedia.org/wiki/Domain_Name_System to understand how DNS works to begin with. That will make the role of the local resolver clearer as well.

Sven
  • 97,248
  • 13
  • 177
  • 225