LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-09-2018, 09:15 AM   #1
coldbeer
Member
 
Registered: May 2006
Location: Orion–Cygnus Arm, MWG
Distribution: Slackware, Ubuntu
Posts: 248

Rep: Reputation: 130Reputation: 130
resolv.conf - how to reload?


I have slackware machines setup with static ips and I had to change the resolv.conf file.

Does the machine have to be rebooted?

What command can I run to reload the resolv.conf file without rebooting?

thx
 
Old 01-09-2018, 09:26 AM   #2
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 14.2 + Multilib
Posts: 1,422

Rep: Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828Reputation: 828
coldbeer --

In my experience, editing resolv.conf has always seemed to be 'good enough' ...

YMMV ... ( and I am not sure what applications may be caching DNS )

-- kjh

This is my resolv.conf:

Code:
# cat /etc/resolv.conf

domain kjh.home
search kjh.home
nameserver 127.0.0.1
nameserver 8.8.8.8
nameserver 192.168.0.1
What server is resolving hostnames for me ( note the SERVER section at the end of the dig output ) ?

Code:
; <<>> DiG 9.10.5-P3 <<>> any google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6319
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 4, ADDITIONAL: 5

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;google.com.                    IN      ANY

;; ANSWER SECTION:
google.com.             86281   IN      CAA     0 issue "pki.goog"

<<snip>>

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Jan 09 09:21:20 CST 2018
;; MSG SIZE  rcvd: 458
Change my resolv.conf

Code:
# cat /etc/resolv.conf

domain kjh.home
search kjh.home
nameserver 8.8.8.8
nameserver 192.168.0.1
nameserver 127.0.0.1
Which SERVER is resolving host names now ?

Code:
# dig any google.com

<<snip>> - jump to the punch line ...

;; Query time: 36 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Jan 09 09:23:54 CST 2018
;; MSG SIZE  rcvd: 384
 
1 members found this post helpful.
Old 01-09-2018, 09:27 AM   #3
coldbeer
Member
 
Registered: May 2006
Location: Orion–Cygnus Arm, MWG
Distribution: Slackware, Ubuntu
Posts: 248

Original Poster
Rep: Reputation: 130Reputation: 130
Smile

Looks like resolv.conf changes are effective immediately.

Using the 'dig' command the dns host used is shown at the bottom:

;; Query time: 81 msec
;; SERVER: 144.111.55.235#53(144.111.55.235)
;; WHEN: Tue Jan 09 10:21:30 EST 2018

After I change the resolv.conf and run dig again:

;; Query time: 0 msec
;; SERVER: 144.111.44.79#53(144.111.44.79)
;; WHEN: Tue Jan 09 10:22:11 EST 2018
;; MSG SIZE rcvd: 268
 
Old 01-09-2018, 09:28 AM   #4
coldbeer
Member
 
Registered: May 2006
Location: Orion–Cygnus Arm, MWG
Distribution: Slackware, Ubuntu
Posts: 248

Original Poster
Rep: Reputation: 130Reputation: 130
Quote:
Originally Posted by kjhambrick View Post
coldbeer --

In my experience, editing resolv.conf has always seemed to be 'good enough' ...

YMMV ... ( and I am not sure what applications may be caching DNS )

-- kjh

This is my resolv.conf:

Code:
# cat /etc/resolv.conf

domain kjh.home
search kjh.home
nameserver 127.0.0.1
nameserver 8.8.8.8
nameserver 192.168.0.1
What server is resolving hostnames for me ( note the SERVER section at the end of the dig output ) ?

Code:
; <<>> DiG 9.10.5-P3 <<>> any google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6319
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 4, ADDITIONAL: 5

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;google.com.                    IN      ANY

;; ANSWER SECTION:
google.com.             86281   IN      CAA     0 issue "pki.goog"

<<snip>>

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Jan 09 09:21:20 CST 2018
;; MSG SIZE  rcvd: 458
Change my resolv.conf

Code:
# cat /etc/resolv.conf

domain kjh.home
search kjh.home
nameserver 8.8.8.8
nameserver 192.168.0.1
nameserver 127.0.0.1
Which SERVER is resolving host names now ?

Code:
# dig any google.com

<<snip>> - jump to the punch line ...

;; Query time: 36 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Jan 09 09:23:54 CST 2018
;; MSG SIZE  rcvd: 384
I just did the same thing :-) Thanks!
 
Old 01-13-2018, 11:53 PM   #5
Fat_Elvis
Member
 
Registered: Oct 2016
Distribution: FreeDOS 1.2
Posts: 215

Rep: Reputation: 57
Changes to resolv.conf do eventually come into effect, but can take a couple of minutes to "stick," IME. I wonder if there's a way of "forcing" the issue.

By the way, NetworkManager, if you are using it, will overwrite changes to resolv.conf.
 
Old 01-14-2018, 03:01 AM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1 on Lenovo Thinkpad W520
Posts: 8,490

Rep: Reputation: Disabled
Quote:
Originally Posted by Fat_Elvis View Post
By the way, NetworkManager, if you are using it, will overwrite changes to resolv.conf.
Which can be prevented if the file system allows it with:
Code:
chattr -V +i /etc/resolv.conf
I do that because my web hoster's name servers are sometimes slow so I prefer to use public ones.

Last edited by Didier Spaier; 01-14-2018 at 03:04 AM.
 
2 members found this post helpful.
Old 01-15-2018, 10:24 AM   #7
Fat_Elvis
Member
 
Registered: Oct 2016
Distribution: FreeDOS 1.2
Posts: 215

Rep: Reputation: 57
Quote:
Originally Posted by Didier Spaier View Post
Which can be prevented if the file system allows it with:
Code:
chattr -V +i /etc/resolv.conf
I do that because my web hoster's name servers are sometimes slow so I prefer to use public ones.
Good info, thanks! I should get around to learning how to set up wi-fi manually one of these days.

Last edited by Fat_Elvis; 01-15-2018 at 10:26 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to reload sysctl.conf in Centos ? dlugasx Linux - Server 2 01-12-2012 08:57 AM
[SOLVED] resolv.conf SeRi@lDiE Slackware 6 08-13-2011 03:31 AM
How to force apache To reload it's conf file????? ral0r3us Programming 2 07-30-2008 06:41 AM
resolv.conf spx2 Linux - Networking 1 01-19-2008 09:00 AM
DNS Hosts.conf or resolv.conf problem mac_casey SUSE / openSUSE 0 03-26-2006 09:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration