keyongtech


  keyongtech > mandriva

 #1  
05-09-08, 04:10 PM
dnoyeB
Where are the currently used DNS servers stored? I know I can get network
card status with ifstatus. How do I get the IP of the list of DNS servers
being used to resolve names currently?

Thanks,


CL
 #2  
05-09-08, 04:49 PM
Bit Twister
On Fri, 09 May 2008 10:10:42 -0500, dnoyeB wrote:
> Where are the currently used DNS servers stored? I know I can get network
> card status with ifstatus. How do I get the IP of the list of DNS servers
> being used to resolve names currently?


cat /etc/resolv.conf
 #3  
05-09-08, 05:42 PM
Aragorn
Bit Twister wrote:

> On Fri, 09 May 2008 10:10:42 -0500, dnoyeB wrote:
>
>> Where are the currently used DNS servers stored? I know I can get
>> network card status with ifstatus. How do I get the IP of the list of
>> DNS servers being used to resolve names currently?

>
> cat /etc/resolv.conf


And if the DNS servers are listed by their domain name rather than by their
IP address...

ping -c 1 ns1.domain.com

;-)
 #4  
05-10-08, 02:50 PM
dnoyeB
On Fri, 09 May 2008 15:49:50 +0000, Bit Twister wrote:

> On Fri, 09 May 2008 10:10:42 -0500, dnoyeB wrote:
>> Where are the currently used DNS servers stored? I know I can get network
>> card status with ifstatus. How do I get the IP of the list of DNS servers
>> being used to resolve names currently?

>
> cat /etc/resolv.conf


Thanks. Now how do the addresses get there? How do I get them to update
when they are incorrect?
 #5  
05-10-08, 03:35 PM
Aragorn
dnoyeB wrote:

> On Fri, 09 May 2008 15:49:50 +0000, Bit Twister wrote:
>
>> On Fri, 09 May 2008 10:10:42 -0500, dnoyeB wrote:
>>> Where are the currently used DNS servers stored? I know I can get
>>> network
>>> card status with ifstatus. How do I get the IP of the list of DNS
>>> servers being used to resolve names currently?

>>
>> cat /etc/resolv.conf

>
> Thanks. Now how do the addresses get there? How do I get them to update
> when they are incorrect?


Presuming that you're on a dynamic IP address, the DNS info is transfered to
your system and updated via your DHCP client daemon, which will in turn
write them to */etc/resolv.conf* - bear in mind that the file is
overwritten at every boot, so anything you save there will get lost on
reboot.

It *is* however possible to configure your DHCP client to leave
*/etc/resolv.conf* alone - setting the file read-only won't work as the
DHCP client runs with root privileges, which it needs in order to overwrite
*/etc/resolv.conf* (and thus to the root filesystem) anyway - but for that
you'd have to check the /man/ page for the actual DHCP client you're using.

Mandriva usually comes with multiple DHCP clients, from which you choose one
during system installation, e.g. /dhclient,/ /dhcpdcd,/ /dhcpxd,/ et al.

Like they say...: if all else fails, Read The /Fine/ Manual... ;-)
 #6  
05-10-08, 04:03 PM
Jim Beard
dnoyeB wrote:
> On Fri, 09 May 2008 15:49:50 +0000, Bit Twister wrote:
>
>> On Fri, 09 May 2008 10:10:42 -0500, dnoyeB wrote:
>>> Where are the currently used DNS servers stored? I know I can get network
>>> card status with ifstatus. How do I get the IP of the list of DNS servers
>>> being used to resolve names currently?

>> cat /etc/resolv.conf

>
> Thanks. Now how do the addresses get there? How do I get them to update
> when they are incorrect?


In /etc/resolvconf/resolv.conf.d you will find three files:
base head tail

Use an ASCII editor (not word processor) as root to make the contents
of head look something like:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by
# resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE
# OVERWRITTEN
#
nameserver 208.67.222.222
nameserver 208.67.220.220

Then reboot or restart your network. The nameervers in
head will be copied over to /etc/resolv.conf. Your dhcpserver
will probably add a third nameserver at the end of the list,
but that will not hurt anything.

Cheers!

jim b.
 #7  
05-10-08, 05:37 PM
Bit Twister
On Sat, 10 May 2008 08:50:58 -0500, dnoyeB wrote:

>> cat /etc/resolv.conf

>
> Thanks. Now how do the addresses get there?


Usually your Comcast dhcp server sends them to your dhclient when
you bring up the network if you have set the nic as dynamic.

$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp <======= indicates use dhcp to get ip values
ONBOOT=no
METRIC=10
MII_NOT_SUPPORTED=no
USERCTL=no
RESOLV_MODS=no
IPV6INIT=no
IPV6TO4INIT=no
DHCP_CLIENT=dhclient <======= name of dhcp client to run
NEEDHOSTNAME=no
PEERDNS=yes
PEERYP=no
PEERNTPD=no



cat /var/lib/dhcp/dhclient-eth0.leases
to see what is sent from the dhcp server.

> How do I get them to update when they are incorrect?


Several methods. You can create /etc/dhclient-exit-hooks or /sbin/ifup-local
to decide when they are incorrect and make any adjustments.

How do you know they are incorrect?
 #8  
05-10-08, 07:57 PM
ERACC
On Sat, 10 May 2008 08:50:58 -0500
"dnoyeB" <none> wrote:

> On Fri, 09 May 2008 15:49:50 +0000, Bit Twister wrote:
>
> > On Fri, 09 May 2008 10:10:42 -0500, dnoyeB wrote:
> >> Where are the currently used DNS servers stored? [...]

> >
> > cat /etc/resolv.conf

>
> Thanks. Now how do the addresses get there? How do I get them to update
> when they are incorrect?


http://blog.eracc.com/2008/02/19/man...-from-the-cli/

Gene (e-mail: usenet0 \a\t eracc \d\o\t com)
 #9  
05-10-08, 08:08 PM
Bit Twister
On Sat, 10 May 2008 13:57:06 -0500, ERACC wrote:
>
> [..]


I disagree with your second paragraph.

In my opinion, if you want different resolver values for your static
interface you define them when you define the static interface.

$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.1.131
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
ONBOOT=yes
METRIC=10
MII_NOT_SUPPORTED=no
USERCTL=no
DNS1=192.168.1.131 <===============
DNS2=208.67.222.222 <===============
DOMAIN=home.test
RESOLV_MODS=no
IPV6INIT=no
IPV6TO4INIT=no

$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.131
nameserver 208.67.222.222
search home.test
 #10  
05-11-08, 02:17 AM
dnoyeB
On Sat, 10 May 2008 16:37:40 +0000, Bit Twister wrote:

[..]
>> cat /var/lib/dhcp/dhclient-eth0.leases

> to see what is sent from the dhcp server.
>> Several methods. You can create /etc/dhclient-exit-hooks or /sbin/ifup-local

> to decide when they are incorrect and make any adjustments.
>
> How do you know they are incorrect?


I was reworking my home network so I had the modem unplugged a bit.
So my router dumped its DNS server when I unplugged the modem, and the
Linux box lost/renewed its DNS servers when I unplugged/plugged it.

So the Linux box got DNS servers from the router during the time the
router did not have the proper data. Doing ifdown/ifup did not cause the
DNS servers to be renewed. I could not figure out how to get them to
renew.

Thanks
 #11  
05-15-08, 10:49 PM
ERACC
On Sat, 10 May 2008 19:08:14 +0000 (UTC)
Bit Twister <BitTwister> wrote:

> On Sat, 10 May 2008 13:57:06 -0500, ERACC wrote:
> >
> > [..]

>
> I disagree with your second paragraph.
>
> In my opinion, if you want different resolver values for your static
> interface you define them when you define the static interface.
>
> $ cat /etc/sysconfig/network-scripts/ifcfg-eth0

[...]
> DNS1=192.168.1.131 <===============
> DNS2=208.67.222.222 <===============

[...]
>
> $ cat /etc/resolv.conf
> # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
> # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
> nameserver 192.168.1.131
> nameserver 208.67.222.222
> search home.test


Hmmm, good point. May I quote you on that in the comments section of that blog
page?

Gene (e-mail: usenet0 \a\t eracc \d\o\t com)
 #12  
05-15-08, 11:42 PM
Bit Twister
On Thu, 15 May 2008 16:49:47 -0500, ERACC wrote:
>
> Hmmm, good point. May I quote you on that in the comments section of
> that blog page?


No idea what you would be "quoting me on"

You indicated something to the effect
there was confusion among Mandriva users setting
/etc/resolvconf/resolv.conf.d/ files for a static ip.

I disagree.

I was just pointing out, when you configure a nic for a static ip, you
can enter two dns values. The nic configuration file will contain the two
values. When the nic is brought up, the DNS(1,2) values are copied into
/etc/resolv.conf.

Same will hold for a dynamic (dhcp) setup, but you have to click
advanced to fill in the DNS values and also disable getting DNS values
from the servers when in the Mandriva Control Center (mcc).

In either case, no /etc/resolvconf/resolv.conf.d/* files are required
to be modified unless you want to some other line(s) in /etc/resolv.conf.
 #13  
05-16-08, 04:22 AM
ERACC
On Thu, 15 May 2008 22:42:50 +0000 (UTC)
Bit Twister <BitTwister> wrote:

> On Thu, 15 May 2008 16:49:47 -0500, ERACC wrote:
> >
> > Hmmm, good point. May I quote you on that in the comments section of
> > that blog page?

>
> No idea what you would be "quoting me on"


The fact that you have a difference of opinion where one should edit. It is a
valid argument that should be included. I do not *have* to "quote" you, just
include the point you made as a comment. Since you read the article and made a
point of mentioning your thoughts I felt it proper to ask you before I quote
on my company web log something that you wrote.

Gene (e-mail: usenet0 \a\t eracc \d\o\t com)
 #14  
05-16-08, 05:06 AM
Bit Twister
On Thu, 15 May 2008 22:22:57 -0500, ERACC wrote:

> The fact that you have a difference of opinion where one should
> edit. It is a valid argument that should be included. I do not
> *have* to "quote" you, just include the point you made as a
> comment. Since you read the article and made a point of mentioning
> your thoughts I felt it proper to ask you before I quote on my
> company web log something that you wrote.



I have no problem with anyone about quoting something I say on Usenet.

As an FYI:
"There appears to be confusion in the Mandriva community about how to
manage a PC using a static IP address (no DHCP client) with static
nameserver entries in /etc/resolv.conf from the Linux command line
interface (CLI)."

That is a pretty broad paint brush you are painting with there. :(
There is more than one way to set DNS servers.

As for the,
"The proper files to edit under Mandriva for /etc/resolv.conf
at this point are in /var/run/resolvconf/interface/ and/or
/etc/resolvconf/resolv.conf.d/. "

I question "The proper files" part.

During install you get to define/hardcode the DNS servers. Those settings are
stored in DNS1 and DNS2 variables in the nic's configuration file.
Mandriva Control Center allow you to set/change them after install for
both static or dhcp setup.

As the nic is brought up or in service, /etc/resolv.conf will contain
those values.

So, in my opinion, /etc/sysconfig/network-scripts/ifcfg-ethX would be
the "proper file to edit". :)
 #15  
05-16-08, 07:21 AM
Gringo
Aragorn wrote:
> Bit Twister wrote:
>> And if the DNS servers are listed by their domain name rather than by their

> IP address...
>
> ping -c 1 ns1.domain.com
>
> ;-)
>


That's funny, you need the IP address of the name servers, so if
you listed the name servers by FQDN instead of IP address then
you would also need the name servers correctly configured with
some other name service (NIS, /etc/hosts. etc).

Seems a bit backwards to list nameservers by FQDN.

Similar Threads
Thread Thread Starter
Should the public folder store be deleted on other servers when youhave dedicated PF servers?

Hello, We're expanding our existing Exchange 2003 installation and are in the middle of installing clustered mailbox servers. Once they're installed, we'll add two,...

Alan
Is there any tool to enumerate all servers in a domain, including hidden servers?

We have most of our servers hidden for security reasons. Is there any way to enumerate all servers, including hidden ones?

Mike Matheny
Swithing from office servers to alternative backup servers - email / domain setup question

Hi there, We are setting up two Windows Servers as dummy servers as part of a disaster recovery solution (Waiting ready and setup in case of disaster in the office). These...

news.microsoft.com
Scan subnet for Windows servers and return the Names of the servers

Hi, I have been asked to scan 70 some subnets and return the names, ip and OS of all servers found. I am only interested in Windows servers so UNIX boxes, routers and...

OldDog
Connectivity between Windwos 2000 Citrix servers and Windows 2003 file servers

Hi, We've got 5 citrix terminal servers running. They run on W2k with Sp3 and all the updates installed. On top of that we've got Citrix MetaFrame XP FR3 running. The...

Martijn

Privacy Policy | All times are GMT. The time now is 12:36 PM.

Merging Information Logo
[Deutschland] [Espaņa] [France] [Italia] [Nederland] [Polska] [United Kingdom]