Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved]append/change search line within /etc/resolv.conf
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3716
Location: Hamburg

PostPosted: Tue Jun 16, 2009 1:42 pm    Post subject: [solved]append/change search line within /etc/resolv.conf Reply with quote

I'd like to change the search line within that file with sth. like "sed -i" but I'm unsure about the regex for that ...

Last edited by toralf on Tue Jun 16, 2009 2:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
alex.blackbit
Advocate
Advocate


Joined: 26 Jul 2005
Posts: 2397

PostPosted: Tue Jun 16, 2009 2:41 pm    Post subject: Reply with quote

like that?
Code:
sed -i 's/search .*/search new_domain/' resolv.conf

of course i did not test that on my real resolv.conf, but on a local copy.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3716
Location: Hamburg

PostPosted: Tue Jun 16, 2009 2:50 pm    Post subject: Reply with quote

of course - thx
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Tue Jun 16, 2009 4:54 pm    Post subject: Reply with quote

what are you exactly trying to do? changing the same line at every boot? If so, then there is a better way to do that, check your dhcp documentation (or /etc/conf.d/net.example ? )
_________________
The End of the Internet!
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3716
Location: Hamburg

PostPosted: Tue Jun 16, 2009 5:10 pm    Post subject: Reply with quote

truc wrote:
what are you exactly trying to do? changing the same line at every boot? If so, then there is a better way to do that, check your dhcp documentation (or /etc/conf.d/net.example ? )
No, want adapt that line only if I'm within office LAN or within VPN or or or ... so I dont want let dhcpcd do that b/c at home I'v only a thumb DSL modem therefore DHCP doesn't work there.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum