WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to configure nameservers of choice with udhcpc  (Read 21831 times)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
How to configure nameservers of choice with udhcpc
« on: December 05, 2010, 02:56:17 PM »
In case you prefer to define nameservers of your choice (e.g. public DNS servers), rather than what is predefined by your dhcp server, here is how to achieve this by using udhcpc:

1. Open /usr/share/udhcpc/default.script as root in the editor of your choice.

2. After the first line which is commented out, insert a line as in following example:
Code: [Select]
dns="8.8.8.8 8.8.4.4"Note: The specific upper IP's would be google's public DNS servers and hereby serve just as an example and by no means as a recommendation.

3. Add the modified udhcpc script to your backup list:
Code: [Select]
echo usr/share/udhcpc/default.script >>/opt/.filetool.lst
4. Do a backup, just in case   ;)

Note: This method of course will only influence instances of udhcpc which run after restoring the backup, so probably not in cases where a dhcpc lease is automatically gained at boot time. Of course the modified file could also be included in a remaster, in that case it would even be in effect at boot time.
« Last Edit: December 05, 2010, 03:47:35 PM by tinypoodle »
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: How to configure nameservers of choice with udhcpc
« Reply #1 on: January 26, 2013, 05:56:29 AM »
For more examples regarding configuration of udhcpc see also here:
http://git.busybox.net/busybox/tree/examples/udhcp
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)