Slackware This Forum is for the discussion of Slackware Linux.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
01-09-2018, 09:15 AM
#1
Member
Registered: May 2006
Location: Orion–Cygnus Arm, MWG
Distribution: Slackware, Ubuntu
Posts: 249
Rep:
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
01-09-2018, 09:26 AM
#2
Senior Member
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159
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.
01-09-2018, 09:27 AM
#3
Member
Registered: May 2006
Location: Orion–Cygnus Arm, MWG
Distribution: Slackware, Ubuntu
Posts: 249
Original Poster
Rep:
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
01-09-2018, 09:28 AM
#4
Member
Registered: May 2006
Location: Orion–Cygnus Arm, MWG
Distribution: Slackware, Ubuntu
Posts: 249
Original Poster
Rep:
Quote:
Originally Posted by
kjhambrick
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!
01-13-2018, 11:53 PM
#5
Member
Registered: Oct 2016
Distribution: FreeDOS 1.2
Posts: 309
Rep:
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.
01-14-2018, 03:01 AM
#6
LQ Addict
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,062
Rep:
Quote:
Originally Posted by
Fat_Elvis
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 .
3 members found this post helpful.
01-15-2018, 10:24 AM
#7
Member
Registered: Oct 2016
Distribution: FreeDOS 1.2
Posts: 309
Rep:
Quote:
Originally Posted by
Didier Spaier
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 .
All times are GMT -5. The time now is 03:28 AM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News