DNS not being populated in resolv.conf

Kaushal Shriyan kaushalshriyan at gmail.com
Mon Nov 29 09:16:08 UTC 2010


On Mon, Nov 29, 2010 at 1:16 PM, Tom H <tomh0665 at gmail.com> wrote:

> On Sun, Nov 28, 2010 at 7:15 AM, Kaushal Shriyan
> <kaushalshriyan at gmail.com> wrote:
> > On Sun, Nov 28, 2010 at 4:55 PM, Tom H <tomh0665 at gmail.com> wrote:
> >> On Sun, Nov 28, 2010 at 1:34 AM, Kaushal Shriyan
> >> <kaushalshriyan at gmail.com> wrote:
> >> > On Sat, Nov 27, 2010 at 1:21 PM, Tom H <tomh0665 at gmail.com> wrote:
> >> >> On Fri, Nov 26, 2010 at 9:08 PM, Kaushal Shriyan
> >> >> <kaushalshriyan at gmail.com> wrote:
> >> >> >
> >> >> > I have three Internet Service Provider to connect to internet from
> my
> >> >> > laptop
> >> >> > running Ubuntu Desktop Linux OS 10.04
> >> >> > For example ISP A, ISP B ISP C
> >> >> > ISP A  --> is the Office Network (when i am in office )
> >> >> > ISP B -->  is the Mobile Broadband Network (when i am moving )
> >> >> > ISP C --> is the Home Network (when i am at home)
> >> >> > Also in addition to the above details :-
> >> >> > I have local DNS Server at office, DNS server of Data Center 1 and
> >> >> > DNS
> >> >> > Server of Data Center 2. so whenever i am in office, by default i
> >> >> > need
> >> >> > to
> >> >> > connect to these
> >> >> > three DNS Servers in order to access the servers.
> >> >> > The steps i have followed after using resolvconf
> >> >> > sudo apt-get install resolvconf
> >> >> > sudo rm /etc/resolv.conf
> >> >> > sudo ln -s /etc/resolvconf/run/resolv.conf /etc/resolv.conf
> >> >> > sudo vim /etc/openvpn/update-resolv-conf
> >> >> >
> >> >> > Add the following lines in the beginning.
> >> >> >
> >> >> > foreign_option_1='dhcp-option DOMAIN off.example.com
> dc1.example.com
> >> >> > dc2.example.com'
> >> >> > foreign_option_2='dhcp-option DNS 172.26.0.1'
> >> >> > foreign_option_3='dhcp-option DNS 10.20.0.1'
> >> >> > foreign_option_4='dhcp-option DNS 10.20.0.2'
> >> >> > foreign_option_5='dhcp-option DNS 10.30.0.1'
> >> >> > save and exit
> >> >> > Add the below two lines at the bottom of the file openvpn client
> >> >> > DC1.conf
> >> >> >
> >> >> > up /etc/openvpn/update-resolv-conf
> >> >> > down /etc/openvpn/update-resolv-conf
> >> >> > The issue which i am facing is that I am unable to resolve the
> local
> >> >> > DNS
> >> >> > Servers at office. I need the local DNS Server in order to access
> >> >> > Network
> >> >> > printers
> >> >> > and other devices.
> >> >> > Office DNS Server is off.example.com and DNS Server IP
> is 172.26.0.1
> >> >>
> >> >> Are all five options above for your office network?
> >> >
> >> > Not sure i understand that ?
> >> >>
> >> >> Please post "cat /etc/resolv.conf" after you connect to your office
> >> >> network.
> >> >
> >> > cat /etc/resolv.conf in my Ubuntu Laptop Desktop PC running 10.04
> >> > search off.example.com  ### office
> >> > search dc1.example.com ### DataCenter No.1
> >> > search dc2.example.com' ### DataCenter No. 2
> >> > DNS 172.26.0.1
> >> > DNS 10.20.0.1
> >> > DNS 10.20.0.2
> >> > DNS 10.30.0.1
> >>
> >> This "resolv.conf" is incorrect.
> >>
> >> The "DNS" lines don't mean anything. It shouldn't be "DNS" but
> >> "nameserver".
> >
> > sorry there was a typo, it is actually nameserver
> >
> >> The "search" lines don't make sense (although I could be wrong). I
> >> don't use "search" but I'd expect your "resolv.conf" to have one
> >> search line "search example.com" with your domain and not three with
> >> boxes.
> >
> > search off.example.com  ### office
> > search dc1.example.com ### DataCenter No.1
> > search dc2.example.com' ### DataCenter No. 2
> > nameserver 172.26.0.1
> > nameserver 10.20.0.1
> > nameserver 10.20.0.2
> > nameserver 10.30.0.1
> > Are you saying it should be as below  :-
> > foreign_option_1='dhcp-option DOMAIN off.example.com' ### office
> > foreign_option_2='dhcp-option DOMAIN dc1.example.com' ### DataCenter
> No.1
> > foreign_option_3='dhcp-option DOMAIN dc2.example.com' ### DataCenter
> No.2
> > foreign_option_4='dhcp-option DNS 172.26.0.1' ### office
> > foreign_option_5='dhcp-option DNS 10.20.0.1'  ### DataCenter No.1
> > foreign_option_6='dhcp-option DNS 10.20.0.2'  ### DataCenter No.1
> > foreign_option_7='dhcp-option DNS 10.30.0.1'  ### DataCenter No.2
> >>
> >> (I'd asked whether the five "foreign_option_X" were for your three
> >> locations or just for your office.)
> >
> > foreign_option_X was for the three locations viz office,data center 1 and
> > data center 2
>
> OK for "nameserver".
>
> No, I wasn't suggesting the you spread the "search" values over three
> lines. I was curious as to how the script that's putting your
> "resolv.conf" together could distinguish between your locations. Since
> you only have your office DNS settings, it's not relevant.
>
> I'm still not clear on "search off.example.com dc1.example.com
> dc2.example.com". Are off.example.com, dc1.example.com,
> dc2.example.com subdomains of example.com or servers? For example, I'd
> assumed that "dcX..." referred to AD DCs.
>
> Is a host, whose short name is "box", in your office called
> "box.off.example.com" or "box.example.com"?
>
> Since your "resolv.conf" is correct, assuming that you've used the
> correct DNS server ip addresses, what happens when you run a DNS
> query?
>
> What's the output of
> grep hosts /etc/nsswitch.conf
> dig +trace office_server
> dig +trace +nosearch office_server
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>

Hi Tom

kaushal at kaushal-laptop:~$ grep hosts /etc/nsswitch.conf
hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
kaushal at kaushal-laptop:~$ dig +trace 172.26.0.1

; <<>> DiG 9.7.0-P1 <<>> +trace 172.26.0.1
;; global options: +cmd
;; connection timed out; no servers could be reached
kaushal at kaushal-laptop:~$ dig +trace +nosearch 172.26.0.1

; <<>> DiG 9.7.0-P1 <<>> +trace +nosearch 172.26.0.1
;; global options: +cmd
;; connection timed out; no servers could be reached
kaushal at kaushal-laptop:~$ping 172.26.0.1
PING 172.26.0.1 (172.26.0.1) 56(84) bytes of data.
64 bytes from 172.26.0.1: icmp_seq=1 ttl=64 time=2.96 ms
64 bytes from 172.26.0.1: icmp_seq=2 ttl=64 time=0.137 ms
64 bytes from 172.26.0.1: icmp_seq=3 ttl=64 time=0.142 ms
^C
--- 172.26.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.137/1.081/2.966/1.332 ms
kaushal at kaushal-laptop:~$netstat -r | grep -w default
default         172.26.0.1    0.0.0.0         UG        0 0          0 eth0
kaushal at kaushal-laptop:~$host off.example.com
off.example.com has address publicIP
kaushal at kaushal-laptop:~$

I dont know why off.example.com resolves to my External Outgoing Public IP
and not Internal LAN Gateway IP.

Please suggest/further.

Thanks and Regards

Kaushal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20101129/3098aaa8/attachment.html>


More information about the ubuntu-users mailing list