This is a static archive of the old Zorin Forum.

The information below may be outdated. Visit the new Zorin Forum here ›

If you have registered on the old forum, you will need to create an account on the new forum.

Not able to flush dns

razedafear

Thu Nov 15, 2012 10:06:47 am

Hi Folks

I am stuck with my DNS conf file. The connection info shows that i am using open DNS servers, Ive set up my router to use open DNS ports. But any dig query on any domain still is being cached from my original ISP DNS.
Code:

umayrz@umayrz-HP-ProBook-4530s:~$ dig last.fm
; <<>> DiG 9.8.1-P1 <<>> last.fm
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47297
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;last.fm.   IN A
;; ANSWER SECTION:
last.fm.  15 IN A 195.24.232.203
;; Query time: 14 msec
;; SERVER: 59.179.243.70#53(59.179.243.70)
;; WHEN: Wed Nov 14 23:04:01 2012
;; MSG SIZE  rcvd: 41
umayrz@umayrz-HP-ProBook-4530s:~$


Tried using this command from root prompt:
Code:
/etc/init.d/nscd restart
here is the ouptput
Selection_013.png


see the screen shot below. The IP DNS with 59.179.243.70 is my ISP DNS while as my connection info shows open DNS server being used.
Selection_012.jpg


connn.jpg

Wolfman

Thu Nov 15, 2012 1:46:49 pm

Hi,

your default IPV4 IP Address is 192.168.1.3 and your default route is 192.168.1.1, maybe that has something to do with it?????.

Have you tried this terminal command:

sudo /etc/init.d/dns-clean

Let us know if this helps.

Regards Wolfman :D

razedafear

Thu Nov 15, 2012 3:36:25 pm

that is because my linux box is behind a Natted router (uses NAT). All my network clients have an internal IP (192.168.x.x range).
Ran the command. It still resolves DNS from my ISP servers. Here is the output.
Code:
umayrz@umayrz-HP-ProBook-4530s:~$ sudo /etc/init.d/dns-clean
[sudo] password for umayrz:
umayrz@umayrz-HP-ProBook-4530s:~$ get last.fm

No command 'get' found, but there are 16 similar ones
get: command not found
umayrz@umayrz-HP-ProBook-4530s:~$
umayrz@umayrz-HP-ProBook-4530s:~$ dig last.fm

; <<>> DiG 9.8.1-P1 <<>> last.fm
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63067
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;last.fm.         IN   A

;; ANSWER SECTION:
last.fm.      1844   IN   A   195.24.232.203

;; Query time: 14 msec
;; SERVER: 59.179.243.70#53(59.179.243.70)
;; WHEN: Thu Nov 15 20:55:14 2012
;; MSG SIZE  rcvd: 41

umayrz@umayrz-HP-ProBook-4530s:~$

Wolfman

Fri Nov 16, 2012 6:59:06 am

Alrighty then,

To be able to flush (clear) DNS cache under Ubuntu 12.04/11.10, try one or more of these methods:

Method 1

Install first the nscd daemon with this command from the terminal:

sudo apt-get install nscd

Then clear your DNS data with this command:

sudo /etc/init.d/nscd restart

Method 2

You can also try to flush DNS cache with this command:

sudo /etc/init.d/networking restart

Method 3

Try also this command:

sudo /etc/init.d/dns-clean start

Good luck!.

Source: http://www.upubuntu.com/2012/05/how-to- ... under.html

Hope it helps you further.

Regards Wolfman :D

razedafear

Sat Nov 17, 2012 10:09:49 am

it still shows up my ISP dns servers being used after i ran these commands.

razedafear

Sat Dec 01, 2012 3:55:05 pm

checked out this issue again. i did not had nscd installed hence could not restart. used a sudo apt-get install nscd to get it and then ran sudo /etc/init.d/nscd restart and it worked. Thanks
However, when i do a dig for a site - last.fm it still shows my ISP dns server being resolved, while as i have another precise machine(on the same home network) running Opendns servers and i can see them when i do a dig from that linux box.

Code:
aasim@aasim-vm:~$ dig last.fm

; <<>> DiG 9.8.1-P1 <<>> last.fm
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13565
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;last.fm.         IN   A

;; ANSWER SECTION:
last.fm.      3180   IN   A   195.24.232.203

;; Query time: 20 msec
;; SERVER: 59.179.243.70#53(59.179.243.70)
;; WHEN: Sat Dec  1 21:24:01 2012
;; MSG SIZE  rcvd: 41


Code:
aasim@aasim-vm:~$ sudo ss -lnp
State      Recv-Q Send-Q        Local Address:Port          Peer Address:Port
LISTEN     0      128               127.0.0.1:631                      *:*      users:(("cupsd",1024,9))
LISTEN     0      128                     ::1:631                     :::*      users:(("cupsd",1024,8))
aasim@aasim-vm:~$