Gentoo Archives: gentoo-user

From: Maxim Wexler <maxim.wexler@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] ppp-gentoo woes cont'd [SOLVED-sorta]
Date: Wed, 28 Mar 2012 20:08:18
Message-Id: CAN_TFxNLkOSDG9uNR8yWaKL=0NPnqta57t6sQrQtK6q11MQWAw@mail.gmail.com
1 >>
2 >>> with ppp connections you are not using a dhcp client, pppd gets the
3 >>> nameserver ip addressess as part of the connection negotiation (if
4 >>> peerdns is set) and the aforemetioned script in
5 >>> /etc/ppp/ip-up.d/40-dns.sh writes those to /etc/resolv.conf
6
7 This is at the top of /etc/resolv.conf
8 # Generated by dhcpcd
9 # /etc/resolv.conf.head can replace this line
10 # /etc/resolv.conf.tail can replace this line
11
12 But according to /var/log/messages:
13
14 Mar 28 13:24:01 lumby pppd[16825]: primary DNS address 75.153.176.1
15 Mar 28 13:24:01 lumby pppd[16825]: secondary DNS address 75.153.176.9
16
17 But whatever is in resolv.conf is overwritten with blanks AFTER I
18 connect. Which creates this odd situation where I can ping numbers,
19 ie, 8.8.8.8 but not com, net, org etc.
20
21 Once I "connect" I have to echo the DNS addresses into resolv.conf
22 before I can reach anything.
23
24 Also, I notice whenever I set up a route to my router those numbers
25 get wiped. Is that the default behavio(u)r?. NB, I have nothing in the
26 way of services other than ppp configured at all. Maybe later after I
27 sort it all out I'll rig up something automatic.
28
29 Thanks for everybody's hlp
30
31 MW
32
33 ps: according to /etc/ppp/ip-up.d/40-dns.sh:
34
35 -------------------------------------------------------------------------------------------------------------------------------
36
37 #!/bin/sh
38
39 # Handle resolv.conf generation when usepeerdns pppd option is being used.
40 # Used parameters and environment variables:
41 # $1 - interface name (e.g. ppp0)
42 # $USEPEERDNS - set if user specified usepeerdns
43 # $DNS1 and $DNS2 - DNS servers reported by peer
44
45 if [ "$USEPEERDNS" ]; then
46
47 if [ -x /sbin/resolvconf ]; then
48 {
49 echo "# Generated by ppp for $1"
50 [ -n "$DNS1" ] && echo "nameserver $DNS1"
51 [ -n "$DNS2" ] && echo "nameserver $DNS2"
52 } | /sbin/resolvconf -a "$1"
53 else
54 # add the server supplied DNS entries to /etc/resolv.conf
55 # (taken from debian's 0000usepeerdns)
56
57 # follow any symlink to find the real file
58 REALRESOLVCONF=$(readlink -f /etc/resolv.conf)
59
60 if [ "$REALRESOLVCONF" != "/etc/ppp/resolv.conf" ]; then
61
62 # merge the new nameservers with the other options from the old configuration
63 {
64 grep --invert-match '^nameserver[[:space:]]' $REALRESOLVCONF
65 cat /etc/ppp/resolv.conf
66 } > $REALRESOLVCONF.tmp
67
68 # backup the old configuration and install the new one
69 cp -dpP $REALRESOLVCONF $REALRESOLVCONF.pppd-backup
70 mv $REALRESOLVCONF.tmp $REALRESOLVCONF
71
72 # correct permissions
73 chmod 0644 /etc/resolv.conf
74 chown root:root /etc/resolv.conf
75 fi
76 fi
77
78 fi
79
80 --------------------------------------------------------------------------------------------------------------------------------
81
82 the software is aware of two resolv.confs, one under /etc/, one under
83 /etc/ppp. /etc/ppp/resolv.conf is correctly filled in, but the other
84 is wiped. Can anyone see why?
85
86 MW

Replies

Subject Author
Re: [gentoo-user] ppp-gentoo woes cont'd [SOLVED-sorta] Joshua Murphy <poisonbl@×××××.com>