how to stop synchroniziing the clock from internet at startup

DavidJonesEllis ulist at gs1.ubuntuforums.org
Tue May 23 16:47:47 UTC 2006


Hi All,

I've finally figured out what is really going on with ntpdate, thanks
to some extensive browsing through old posts about resolv.conf.

*Issue:*
*ntpdate ntp.ubuntulinux.org* does not work
when Ubuntu is booting.

*Cause:*
The *nameserver* entries in */etc/resolv.conf* do not point to valid
dns servers. Even if you set them correctly, they get cleaned out and
reset to the default (your dchp server) as part of the boot process.
This happens because there is a bug in the one of the scripts called up
by the boot script - specifically, */etc/dhcp3/dhclient-script*.

*Solution:*
1. Edit */etc/dhcp3/dhclient-script* to convert the errant code into
comments as follows:

> 
> #make_resolv_conf() {
> #    if [ -n "$new_domain_name" -o -n "$new_domain_name_servers" ];
> then
> #        local new_resolv_conf=/etc/resolv.conf.dhclient-new
> #        rm -f $new_resolv_conf
> #
> #        if [ -n "$new_domain_name" ]; then
> #            echo search $new_domain_name >> $new_resolv_conf
> #        else # keep 'old' search/domain scope
> #            egrep -i '^ *[:space:]*(search|domain)' /etc/resolv.conf
> >> \
> #                  $new_resolv_conf
> #        fi
> #
> #        if [ -n "$new_domain_name_servers" ]; then
> #            for nameserver in $new_domain_name_servers; do
> #                echo nameserver $nameserver >>$new_resolv_conf
> #            done
> #        else # keep 'old' nameservers
> #            egrep -i '^ *[:space:]*nameserver' /etc/resolv.conf >> \
> #                  $new_resolv_conf
> #        fi
> #
> #        chown --reference=/etc/resolv.conf $new_resolv_conf
> #        chmod --reference=/etc/resolv.conf $new_resolv_conf
> #        mv $new_resolv_conf /etc/resolv.conf
> #    fi
> #}
> 

2. Edit */etc/resolv.conf* to include a reference to the dns server
provided by your ISP (your ADSL modem may have it listed - also, if you
have an MS-Windows PC on your network, you may be able to find a DNS
server or two mentioned in the TCP/IP configuration for your LAN setup)
in the format:

NAMESERVER XXX.XXX.XXX.XXX
If your ADSL modem, or modem router is acting as your dhcp server, it
will probably have either 192.168.0.1 or 10.0.0.1 as its IP address, in
which case you probably already have either:

NAMESERVER 192.168.0.1
or:

NAMESERVER 10.0.0.1
already in */etc/resolv.conf* - you can leave them as they are not
doing you any harm, but, if they are not working for you, you should
probably put your ISP's dns address ahead of the default address so
that it gets checked first when trying to resolve domain names.

Hopefully, this bug will be ironed out by the time Dapper Drake becomes
a stable release.

Good luck!

Regards,
David.


-- 
DavidJonesEllis




More information about the ubuntu-users mailing list