嵌入式开发者社区

标题: 文件系统中的dns无法存储 [打印本页]

作者: jinyi7016    时间: 2017-9-29 11:26
标题: 文件系统中的dns无法存储
硬件上:LAN8720,50M有源晶振,晶振上的时钟输出到CVIDEO_DIN1/RMII_MHZ_50_CLK引脚。1 v/ X" F, _% G6 g

+ [2 I6 e! d; s0 q" m8 s& s要设置为静态的IP。4 Y! t0 ?/ c% |
/etc/network/ interfaces 中的内容:
1 C6 A7 q, [6 d: }! m* R8 S
6 U  l5 e7 V1 L4 e# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
2 a* M) I/ a4 U) x. @5 e, O
5 w$ M# U2 \- h6 T, m1 f! _# The loopback interface
0 \0 m( L: U  p! w4 Sauto lo
. x9 d. A$ ]' X7 ?4 D& g" `- e7 ziface lo inet loopback
6 R7 f1 {4 d* }6 L8 K; G- i) U; b; U; a% [! n( r5 D
# Wireless interfaces
5 U# D7 X) D4 j+ R- F5 h- K% w; siface wlan0 inet dhcp
) Y& g$ i' [" J5 R- _. v, U, W        wireless_mode managed
  j) b3 ]0 @. J/ b/ i+ e        wireless_essid any% k9 L  ^2 t* W/ k% [
        wpa-driver wext. g2 b8 t6 ~. d6 X7 x, o# u# w  J
        wpa-conf /etc/wpa_supplicant.conf
1 r: v$ }* R# |* h3 e, ]' N2 o8 N9 N$ O7 E8 w2 p/ ?" Q
iface tiwlan0 inet dhcp
5 u6 x4 M3 O6 S, z# G( q# I3 j8 ]        wireless_mode managed
- w4 L1 r7 M7 o        wireless_essid any
. f/ D- E! R& ^; v' C% Z2 J
6 w  }) o. L9 T* Niface atml0 inet dhcp* w- V- E: {6 {/ k8 a, J
; u: p6 V4 P2 m! g6 {: l0 U+ \
# Wired or wireless interfaces
3 @; E6 D8 v4 e. Xauto eth0; L/ v- n. P6 K$ K; ~. y
#iface eth0 inet dhcp
, |- j8 v$ Z2 o6 _8 L- r8 Wiface eth0 inet static# ?# n, X0 X; H% ]0 b
address 192.168.11.1700 L; s8 }) f  L) G: Y& I
netmask 255.255.255.0- n( J5 e3 V1 L! E
gateway 192.168.11.1& q! |$ p7 f- a! E
0 m1 }4 r* e8 p5 i; J

5 p0 J, g$ A& y" y4 d  C( {0 P+ L #       pre-up /bin/grep -v -e "ip=[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+" /proc/cmdline > /dev/null+ J1 C; Y, F( ?, V/ p5 k" Z

# e8 b" k# \" t, [, p3 Z. t" M#iface eth1 inet dhcp
" o8 j: c, D: q9 C$ J" X4 Z1 [& D  {: @& B3 }: _+ A- y  S; w
# Ethernet/RNDIS gadget (g_ether)' [  s! I/ g, Y! K; `, ]1 h
# ... or on host side, usbnet and random hwaddr
0 D! T) \7 \+ z. D! h/ Eiface usb0 inet dhcp2 z+ N: e9 `1 y" ], W  \

, n' R' n  ^: }3 P7 ~0 W) O3 R# Bluetooth networking
7 j& D8 f' D% j& riface bnep0 inet dhcp' q6 f! |* X% I/ C
. a/ ~$ Q, B6 ^2 U

$ Z, y  J4 Y5 _& G/ J9 m/ c8 t /etc/resolv.conf 配置了DNS,但是重启后,文件就又是空的了。1 H( i8 d9 X. h5 K6 N6 y

* q% V) O4 O; W9 B#ifconfig后的结果
+ f1 N5 E/ `0 x2 oeth0      Link encap:Ethernet  HWaddr 12:00:a0:35:3b:89  ) t4 x! X8 E/ E+ ~) e
          inet addr:192.168.11.170  Bcast:192.168.11.255  Mask:255.255.255.0
2 l/ q" i0 W; p$ U4 u4 D, M          UP BROADCAST MULTICAST  MTU:1500  Metric:1
- y8 G5 ^" S5 E4 f4 s3 n9 B; C          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
0 k1 z6 r( J$ h" l          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
$ B) j' }8 m: B+ ]/ J          collisions:0 txqueuelen:1000 % x& D8 @3 _) o
          RX bytes:0 (0.0 B)  TX bytes:180 (180.0 B); V! y, s' J8 e
          Interrupt:33 8 ^- ~2 o7 Q, a+ W6 u5 c. S
! Q" n, b3 y2 q: P" S
lo        Link encapocal Loopback  $ _- R) r2 k8 c0 Z% q- T+ w+ a
          inet addr:127.0.0.1  Mask:255.0.0.0
& @. U. `3 |' s# n3 W          UP LOOPBACK RUNNING  MTU:16436  Metric:1
# h4 x, w5 o5 W# P          RX packets:165 errors:0 dropped:0 overruns:0 frame:0/ t2 V2 k, N5 B: E/ \: t
          TX packets:165 errors:0 dropped:0 overruns:0 carrier:0
+ U+ e1 |/ M/ F& T! Q5 [/ ?! y          collisions:0 txqueuelen:0
0 m% V$ d4 R3 X$ f1 `3 Z  o          RX bytes:246293 (240.5 KiB)  TX bytes:246293 (240.5 KiB)
% e3 g0 p0 c9 S; B; c* [  S- O" r2 k6 L6 V' F( U  l
$ q9 C! [6 z9 P" G# |

0 e# W3 Z5 g6 ^7 I4 `" b  P /etc/init.d/networking restart后会死机
, j9 J! I+ P+ Z: l) Q9 y, C
7 A; M! x- h. n0 u1 B- i" {- H2 t
作者: jinyi7016    时间: 2017-9-29 12:04
目前网络可以通了,但是DNS存储问题没有解决
作者: 伊撒斯    时间: 2017-9-30 10:14
您好,设置静态ip可以ping通,但是DNS无法存储的话,请问您那边,是否有参照我们提供的哪个例程呢?如果您是需要使用网络文件系统,也可以参考我们的nfs开发环境搭建的参考文档。
作者: 伊撒斯    时间: 2017-9-30 10:15
[attach]2830[/attach]
作者: jinyi7016    时间: 2017-9-30 10:35
伊撒斯 发表于 2017-9-30 10:144 L" z. e) i; V8 i, d& v" Z& _
您好,设置静态ip可以ping通,但是DNS无法存储的话,请问您那边,是否有参照我们提供的哪个例程呢?如果您 ...
0 Z# A, @; l# ^. }+ }9 g
并不是NFS,只是网络的测试。
1 C# h! c# u. f! \就是 /etc/resolv.conf 中的内容添加了dns后,重启就会清空。而其他的文件并不会清空
作者: 伊撒斯    时间: 2017-9-30 19:03
您好:& i2 \; |3 Y/ n8 K

1 Q) H5 {8 g  ?/ J3 g; ]     请问您指的是网络层面的dns存储吗?请问您那边,试过动态映射吗?现在研发工程师已下班,我下周再帮您跟进这个问题吧。
7 M( C) @1 Q  p5 [' m% h6 y5 L
     祝您中秋快乐,阖家团圆,身体健康,工作顺利!
作者: jinyi7016    时间: 2017-10-3 22:09
伊撒斯 发表于 2017-9-30 19:03* K" g1 H) q+ h# x. |
您好:
; N- v/ X& A) u, j+ i! P
7 V+ Y- K& M$ H# R% Z     请问您指的是网络层面的dns存储吗?请问您那边,试过动态映射吗?现在研发工程师已下班,我下 ...

& B' P0 n5 K6 _! o2 x. X可能没有明白我的问题。我现在问的不是网络问题,是文件系统中的一个文件 /etc/resolv.conf,在启动后,其中的内容就没有了。每次重启后,这个文件就成了空的了。




欢迎光临 嵌入式开发者社区 (https://www.51ele.net/) Powered by Discuz! X3.4