php_network_getaddresses error
Issue:
# pear upgrade pear
returns:
php_network_getaddresses: getaddrinfo failed: Name or service not known
Solution:
# chmod a+r /etc/resolv.conf # chmod a+r /etc/nsswitch.conf
nsswitch.conf issue
Issue:
1. Ping OK
# ping http://www.google.ca
Response is normal.
2. Some downloads work, but some not
# wget http://www.centos.org
This and other downloads work
But
# wget http://www.google.ca
returns:
wget: unable to resolve host address http://www.google.ca
Solution:
1. vi /etc/nsswitch.conf
2. Change line of
hosts: files dns
to
hosts: files dns mdns4_minimal [NOTFOUND=return] mdns4
This change fixed the issue and resolve dns normal.
pear error
Issue:
# pear install HTML_Common2
Package “HTML_Common2” Version “2.0.0” does not have REST xml available
install failed
Solution:
This is related to dns resolve problem.
Check:
# wget pear.php.net
Returns:
wget: unable to resolve host address pear.php.net
–> refer to nsswitch.conf issue.
TCP-IP
1. TCP/IP layers
TCP/IP |
OSI |
Application | Application |
presentation | |
Session | |
Transport | Transport |
Internet | Network |
Nwtwork access | Data link |
Physical |
2. Subnet classes
Class A: 0.0.0.0 — 127.255.255.255
Class B: 128.0.0.0 — 191.255.255.255
Class C: 192.0.0.0 — 223.255.255.255
Class D: 224.0.0.0 — 239.255.255.255
Class E: 240.0.0.0 — 255.255.255.255
3. Private IP
Class A: 10.0.0.1 — 10.255.255.254
Class B: 172.16.0.1 — 172.31.255.254
Class C: 192.168.0.1 — 192.168.255.254
4. Auto Private IP
Class B: 169.254.0.0 — 169.254.255.255
Set static IP
1. Disable Network Auto Magic — nwam
# svcadm nwam
# svcadm enable network/physical:default
2. View the network devices
# dladm show-phys LINK MEDIA STATE SPEED DUPLEX DEVICE bge0 Ethernet unknown 1000 full bge0 # dladm show-link LINK CLASS MTU STATE BRIDGE OVER bge0 phys 1500 unknown -- -- # ipadm show-if IFNAME STATE CURRENT PERSISTENT lo0 ok -m-v------46 ---
3. Create and Configure a Logical Interface
# ipadm create-ip bge0 # dladm show-link LINK CLASS MTU STATE BRIDGE OVER bge0 phys 1500 up -- -- # ipadm show-if IFNAME STATE CURRENT PERSISTENT lo0 ok -m-v------46 --- bge0 down bm--------46 -46
4. Create and set DHCP IP
# ipadm create-addr -T dhcp bge0/v4 # ipadm show-addr ADDROBJ TYPE STATE ADDR lo0/v4 static ok 127.0.0.1/8 bge0/v4 dhcp ok 192.168.100.225/24 lo0/v6 static ok ::1/128
5. Delete DHCP IP
# ipadm delete-addr bge0/v4
6. Set static IP
# ipadm create-addr -T static -a 192.168.100.200/24 bge0/v4 # ipadm show-addr ADDROBJ TYPE STATE ADDR lo0/v4 static ok 127.0.0.1/8 bge0/v4 static ok 192.168.100.200/24 lo0/v6 static ok ::1/128
7. Verify settings
# ipadm show-addr ADDROBJ TYPE STATE ADDR lo0/v4 static ok 127.0.0.1/8 bge0/v4 static ok 192.168.100.200/24 lo0/v6 static ok ::1/128 # netstat -r Routing Table: IPv4 Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ---------- --------- solaris solaris UH 2 0 lo0 192.168.100.0 192.168.100.200 U 3 1 bge0 Routing Table: IPv6 Destination/Mask Gateway Flags Ref Use If --------------------------- --------------------------- ----- --- ------- ----- solaris solaris UH 2 4 lo0
8. Add a router
# route -p add default 192.168.100.1 add net default: gateway 192.168.100.1 add persistent net default: gateway 192.168.100.1
Once it has been corrected it should look something like this, and you should be able to ping off-net.
# netstat -r Routing Table: IPv4 Destination Gateway Flags Ref Use Interface -------------------- -------------------- ----- ----- ---------- --------- default fw01.allanglesit.net UG 2 10466 solaris solaris UH 2 12 lo0 192.168.100.0 192.168.100.200 U 6 1810 bge0 Routing Table: IPv6 Destination/Mask Gateway Flags Ref Use If --------------------------- --------------------------- ----- --- ------- ----- solaris solaris UH 2 156 lo0
9. View DNS
# cat /etc/resolv.conf domain allanglesit.net nameserver 192.168.100.22 nameserver 192.168.100.25 # dig www.google.com
11. View DNS search priority
# cat /etc/nsswitch.conf . hosts: files dns ipnodes: files dns
12. Reset system configure if all above not work
# sysconfig unconfigure
# init 6