[SOLVED] DNS Change

Kernels & Hardware, configuring network, installing services

[SOLVED] DNS Change

Postby capcla » 2017-12-02 14:18

Hi,
I've probelm with the configuration of DNS on my Debian. I always use OpenDNS but would change it with Google DNS.
I can't modify DNS on my router and don't use resolv.conf because it is overwritten every restart.
In order to setup my DNS, I use /etc/dhcp/dhcclient.conf where I have configurated Google DNS
Code: Select all
# Configuration file for /sbin/dhclient.
#
# This is a sample configuration file for dhclient. See dhclient.conf's
#   man page for more information about the syntax of this file
#   and a more comprehensive list of the parameters understood by
#   dhclient.
#
# Normally, if the DHCP server provides reasonable information and does
#   not leave anything out (like the domain name, for example), then
#   few changes must be made to this file, if any.
#

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
   domain-name, domain-name-servers, domain-search, host-name,
   dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
   netbios-name-servers, netbios-scope, interface-mtu,
   rfc3442-classless-static-routes, ntp-servers;

#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
#send dhcp-lease-time 3600;
#supersede domain-name "fugue.com home.vix.com";
#prepend domain-name-servers 8.8.8.8, 8.8.4.4;
#require subnet-mask, domain-name-servers;
#timeout 60;
#retry 60;
#reboot 10;
#select-timeout 5;
#initial-interval 2;
#script "/sbin/dhclient-script";
#media "-link0 -link1 -link2", "link0 link1";
#reject 192.33.137.209;

#alias {
#  interface "eth0";
#  fixed-address 192.5.5.213;
#  option subnet-mask 255.255.255.255;
#}

#lease {
#  interface "eth0";
#  fixed-address 192.33.137.200;
#  medium "link0 link1";
#  option host-name "andare.swiftmedia.com";
#  option subnet-mask 255.255.255.0;
#  option broadcast-address 192.33.137.255;
#  option routers 192.33.137.250;
#  option domain-name-servers 127.0.0.1;
#  renew 2 2000/1/12 00:00:01;
#  rebind 2 2000/1/12 00:00:01;
#  expire 2 2000/1/12 00:00:01;
#}


but if I check my DNS on the site https://www.dnsleaktest.com/, it shows that I use OpenDNS.
I use wicd as network manager for my DE. In the past, I used network-manager but now it isn't installed.
Last edited by capcla on 2017-12-02 15:03, edited 1 time in total.
capcla
 
Posts: 8
Joined: 2015-06-24 15:36

Re: DNS Change

Postby Head_on_a_Stick » 2017-12-02 14:31

Do you have the resolvconf package installed?

Check your nameservers directly with the `drill` command:
Code: Select all
empty@Xanadu:~ $ drill
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 43639
;; flags: qr rd ra ; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;; .   IN   NS

;; ANSWER SECTION:
.   518400   IN   NS   c.root-servers.net.
.   518400   IN   NS   i.root-servers.net.
.   518400   IN   NS   m.root-servers.net.
.   518400   IN   NS   g.root-servers.net.
.   518400   IN   NS   e.root-servers.net.
.   518400   IN   NS   l.root-servers.net.
.   518400   IN   NS   a.root-servers.net.
.   518400   IN   NS   j.root-servers.net.
.   518400   IN   NS   d.root-servers.net.
.   518400   IN   NS   f.root-servers.net.
.   518400   IN   NS   k.root-servers.net.
.   518400   IN   NS   h.root-servers.net.
.   518400   IN   NS   b.root-servers.net.

;; AUTHORITY SECTION:

;; ADDITIONAL SECTION:

;; Query time: 16 msec
;; SERVER: 127.0.0.1
;; WHEN: Sat Dec  2 15:18:36 2017
;; MSG SIZE  rcvd: 228
empty@Xanadu:~ $

https://packages.debian.org/stretch/ldnsutils
"Only the mediocre are always at their best." — Jean Giraudoux
User avatar
Head_on_a_Stick
 
Posts: 6803
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: DNS Change

Postby Head_on_a_Stick » 2017-12-02 14:43

capcla wrote:I use /etc/dhcp/dhcclient.conf where I have configurated Google DNS

It looks to me like your domain-name-servers section is commented out, try removing the "#" symbol at the start of the lines.
"Only the mediocre are always at their best." — Jean Giraudoux
User avatar
Head_on_a_Stick
 
Posts: 6803
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: DNS Change

Postby capcla » 2017-12-02 14:44

Head_on_a_Stick wrote:Do you have the resolvconf package installed?


Resolvconf is installed


Head_on_a_Stick wrote:Check your nameservers directly with the `drill` command:
Code: Select all
empty@Xanadu:~ $ drill



Code: Select all
$ drill
;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 35052
;; flags: qr rd ra ; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;; .   IN   NS

;; ANSWER SECTION:
.   518400   IN   NS   a.root-servers.net.
.   518400   IN   NS   b.root-servers.net.
.   518400   IN   NS   c.root-servers.net.
.   518400   IN   NS   d.root-servers.net.
.   518400   IN   NS   e.root-servers.net.
.   518400   IN   NS   f.root-servers.net.
.   518400   IN   NS   g.root-servers.net.
.   518400   IN   NS   h.root-servers.net.
.   518400   IN   NS   i.root-servers.net.
.   518400   IN   NS   j.root-servers.net.
.   518400   IN   NS   k.root-servers.net.
.   518400   IN   NS   l.root-servers.net.
.   518400   IN   NS   m.root-servers.net.

;; AUTHORITY SECTION:

;; ADDITIONAL SECTION:

;; Query time: 92 msec
;; SERVER: 192.168.1.1
;; WHEN: Sat Dec  2 16:31:18 2017
;; MSG SIZE  rcvd: 228
capcla
 
Posts: 8
Joined: 2015-06-24 15:36

Re: DNS Change

Postby Head_on_a_Stick » 2017-12-02 14:50

I usually set static routes on my machines but I think this will do it for dhclient:
Code: Select all
supersede domain-name-servers 8.8.8.8, 8.8.4.4;
"Only the mediocre are always at their best." — Jean Giraudoux
User avatar
Head_on_a_Stick
 
Posts: 6803
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: DNS Change

Postby capcla » 2017-12-02 15:03

Head_on_a_Stick wrote:It looks to me like your domain-name-servers section is commented out, try removing the "#" symbol at the start of the lines.


Ok, I solved.
But, if the row were commented, how could I use OpenDNS?
capcla
 
Posts: 8
Joined: 2015-06-24 15:36

Re: DNS Change

Postby Head_on_a_Stick » 2017-12-02 15:06

capcla wrote:But, if the row were commented, how could I use OpenDNS?

You never were — the `drill` output indicates that your box was "asking" your router ;)
"Only the mediocre are always at their best." — Jean Giraudoux
User avatar
Head_on_a_Stick
 
Posts: 6803
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: DNS Change

Postby capcla » 2017-12-02 15:16

Head_on_a_Stick wrote:
capcla wrote:But, if the row were commented, how could I use OpenDNS?

You never were — the `drill` output indicates that your box was "asking" your router ;)


It's no possible. On my router there isn't the possibility of modify the DNS. If i don't change this parameter of my operative system, my router uses the ISP's DNS
capcla
 
Posts: 8
Joined: 2015-06-24 15:36

Re: DNS Change

Postby Head_on_a_Stick » 2017-12-02 15:17

capcla wrote:my router uses the ISP's DNS

Yes, that's what I meant.

If you check the output of `ip r` then it should show 192.168.1.1 as the default.
"Only the mediocre are always at their best." — Jean Giraudoux
User avatar
Head_on_a_Stick
 
Posts: 6803
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: DNS Change

Postby capcla » 2017-12-02 15:24

Head_on_a_Stick wrote:You never were — the `drill` output indicates that your box was "asking" your router ;)


Excuse me, I've some problems with English :D
However https://www.dnsleaktest.com/ shows me that I used OpenDNS and not my ISP's DNS.
Thank you
capcla
 
Posts: 8
Joined: 2015-06-24 15:36


Return to System configuration

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable