First of all, please clean up your configuration. Is your eth0
interface supposed to be configured with a static IP address or with DHCP? If static, why are you running dhclient
? If DHCP, why does /etc/network/interfaces
list static IP parameters and iface eth0 inet static
instead of iface eth0 inet dhcp
? Also, there is no reason you would need to add a default route via your up route
command since you already specified the default route as the gateway
parameter.
Now keep in mind that as per the name, prepend domain-name-servers
adds DNS servers to the list that is supplied by the DHCP server. It doesn't replace them.
I recommend that, instead of asking dhclient
to customize the name servers you want to use, use the resolvconf
framework instead. resolvconf
coordinates all of the different possible sources of DNS nameserver information (including separate DHCP clients running on one or more network interfaces, local DNS servers you want to use as resolvers, and static configuration) and centralized the building of a single coherent /etc/resolv.conf
file. It's much better than letting several different things manage /etc/resolv.conf
and have them stomp over each other trying to do it.
Install the resolvconf
package if it isn't already installed. This will automatically disable dhclinent
's direct mucking with the /etc/resolv.conf
file.
Now your requirement is that you don't want to use the nameserver(s) provided by the DHCP server, so comment the line that reads eth*
in /etc/resolvconf/interface-order
. Be sure to also comment the last line of the file that reads *
, otherwise eth0
will still be considered.
Next, you want to use a set of statically provisioned nameservers instead. Since they're system-global (not related to the state if any given interface), you can add them as nameservers on the lo interface in /etc/network/interfaces
:
iface lo inet loopback
dns-nameservers x.x.x.x y.y.y.y z.z.z.z
And then ifdown lo; ifup lo
to activate this.
Your domain name provider should also have nameservers available for you to use.
The details will vary with provider, but essentially are:
- Change the NameServers to "use our nameservers"
- Wait (typically this step takes between 1 - 24 hours
- Select "Change DNS settings" (or equivalent)
You should now have the ability to set your A and CNAME records, and will be able to add your static IP address.
Unfortunately, without knowing your specific provider, I can't provide more specific steps.
Best Answer
Go to Network Tools
Select the "DNS Records" option. By default, your external IP is currently in the search box. Click the "Go!" button. This will show you all the DNS records including the official IP address of your ISP's name servers.
Here's an example:
However, you may also find it better to browse the help pages for your ISP. They usually publish what numbers should be used for DNS. What you find using Network Tools is actually the IP addresses of the DNS servers that server the hostnames for your ISP's domain. They may have other caching DNS servers with different IP's that you should use for resolving DNS queries on the internet.
EDIT
I think I better point out the difference between a straight nameserver, and a caching recursive nameserver or DNS Cache
A nameserver simply responds to name queries for the records that it is responsible for. In the case of an ISP, it's only for the ISP's domain and those that have been delegated to it.
A caching recursive nameserver. Is a server that'll actually resolve addresses on behalf of the one querying it that can be outside of the those delegated to the server.
BIND, the most common nameserver on the internet combines both functions. It's both a nameserver and a recursive nameserver.
There is a lot of DNS terminology going around and many names of the same thing. But basically, one just answers for it's domains, while another will answer for other domains too. That's why you can often get away with pointing your DNS queries at your IP's authoritive DNS servers. Don't do that though, use the IP's they give you or allow DHCP to do it.
So, my first answer to your question "How do I determine the IP address of you ISP's nameserver" is correct. BUT, I think you want "How do I determine the IP address of my ISP's DNS Cache?" is probably what you want.
Hopefully, the answer is found published on your ISP's website in the help or support pages. This should also be set through DHCP in your modem/router and can be viewed in it's built in web page or through the devices command line.